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>
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>
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>
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>
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>
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>
Fix Tx ISO Data packet sequence number increment based on
the send timer timeout value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Relax Tx ISO SDUs being dropped in unicast audio client and
server samples when using the Zephyr Bluetooth Low Energy
Controller, i.e. Tx ISO SDUs dropped due to delayed ISO data
send calls in upper layer with respect to payload number in
the current ISO radio events in the Controller.
This option is disabled in the sample and users can use it
when need be.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Zephyr Bluetooth Low Energy Controller overlay config for
the unicast audio client and server samples.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Only print incoming data when the data is valid. Otherwise we also
print incoming data when no data was received.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from samples. 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>
Enable the send timer only when at least one ASE source is enabled,
CONFIG_BT_ASCS_ASE_SRC_COUNT > 0 in case of unicast_audio_server,
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 0 for unicast_audio_client.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Add a new endpoint callback that is used to report the found
ASEs during BAP discovery, rather than calling
the discovery callback with optional values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a new pac_record callback that is used to report the found
PAC records during BAP discovery, rather than calling
the discovery callback with optional values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the BAP unicast client specific discover parameter struct.
This make the BAP discover work more similar to the other
profiles.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The direction has been moved to a function parameter instead,
and we keep a local copy of the value in the stack instead.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>
Use BT_CONN_TX_USER_DATA_SIZE when defining pools of buffers that will go
through `bt_conn_send_cb()`.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
The unicast client used the BT_DATA_UUID16_SOME and
BT_DATA_UUID16_ALL instead BT_DATA_SVC_DATA16 for
discovering ASCS servers.
BT_DATA_SVC_DATA16 is the right one to use, as that
is mandatory for a server to advertise, and the UUID
ones are only recommended. Furthermore, the service data
of the ASCS server can now also be retrieved.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Several places used the bt_audio prefix where it shouldn't.
Also moved the BAP documentation to its own file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added a new header file bap_lc3_preset.h which contains
the definitions of the LC3 (pre)sets defined by the
BAP spec.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the bt_audio_unicast_client API to bt_bap_unicast_client
and move the API to bap.h
Also adds the _bap_ infix to the bt_unicast_client functions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removes the unused pac_pache from the unicast_client.
This moves the storing of the PAC records (in the form of
struct bt_codec) from the stack to the upper layers.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Allow the Unicast Audio Client sample to work if there are no
sink or no source ASEs on the remove device (e.g. if the remote
device only has sink ASEs).
If the remote have neither, it will abort.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes the application that was not waiting for QoS configuration of
all streams in the group. The QoS operation is done on group of streams,
while the status of each one of the streams is received separately.
Meaning that the application has to control which streams were already
configured before enabling them.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Allow the streams to be paired when creating unicast group. This will
allow to reuse the same ISO for the paired streams.
Fixes: #51796
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add the ISO packing field when creating a unicast group.
This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The sequence number is by the core spec defined as 16-bit.
We had implemented a workaround for the wrapping of the
sequence number, which required the type to be larger
than 16-bit (32-bit).
However, since the definition of the sequence number,
and the use of, is poorly defined by the core spec, we
are reverting this workaround and reducing the sequence
number to 16-bit again. This way it is more in line
with the core spec, as well as more intuitive given the
other uses for the sequence number.
This change moves the responsibility of using the
right value to the upper layers, as the stack can
and will no longer provide any guarantees.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The old project, liblc3codec, is not used anymore. Rename the Zephyr
module name, folders, and Kconfig options based on the new name, liblc3.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The unicast client will now read the PACS location value
during the discovery procedure, as well as subscribing to
it.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the sample to reset data and restart scanning for new
unicast audio servers if the connected one disconnected.
This does not handle if a disconnect happens in the middle of
setting up the audio streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>