So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
STM32L562 Discovery kit is not compatible with Bluetooth over USB
application.
Add missing information related to the BLE capability of this board.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Change the integration target to something more meaningfull,
i.e. something users are more likely want to try it on,
and therefore in which it is better to do more testing.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Remove the qemu targets for the controller configuration.
As those do not support the controller, it is just meaningless.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Provide configuration for native_sim instead of native_posix
and enable it in the samples.yaml
native_posix is being deprecated in favour of native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a test based on the unicase client/server samples
which runs them together and after waiting for a predefined
amount of time, checks how many audio packets has the
client received, and if over a threshold, passes the test.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Due to this bug:
https://github.com/zephyrproject-rtos/zephyr/issues/64574
We need to increase the number of L2CAP Tx Buffers
so this sample can be used.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Provide a configuration for the sample we can use
by default with the ISO capable hci_rpmsg controller
sample.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
So that for both the simulated nrf5340 and real HW nrf5340dk
we build both network and application core images.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for the simulated nrf5340 and nrf52 in these samples.
And enable building in twister both for these and for the
already supported nrf5340dk.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>
In 85bb2624bc
init_lc3()'s prototype was changed to return an int,
but the code was not updated to return something !=0
on all errors, or 0 on error.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The lc3_enable code was refering to a variable that does not exist.
Fix it.
Issue was introduced in 9c47eb924f.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The broadcast audio samples (broadcast_audio_sink
and broadcast_audio_source) are sending mock data,
the apps are improved by using the LC3 module as
the unicast audio samples do.
Signed-off-by: Ping Wang <pinw@demant.com>
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF and adjust
CONFIG_LIBC_MALLOC_ARENA_SIZE as needed.
Signed-off-by: Keith Packard <keithp@keithp.com>
In the iso_receive sample, the semaphores were not reset in
each iteration.
This caused the ISO receiver to act incorrectly and cause
issues with some controllers.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BT Core Spec v5.4 allows separate SDU_Interval to
be set on C_To_P and P_To_C directions,
but this is not possible with the existing interface.
This PR splits the interval parameter in the call to
bt_iso_sig_create into one for C_To_P
and one for P_To_C
It also splits the latency parameter into one for
C_To_P and one for P_To_C
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Bluetooth: ISO: update UI for extended API
The API for setting the SDU interval and latency have been updated.
This PR also updates the setting of these by the user in the shell
and the iso_connected_benchmark sample
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Add additional RX stats for the BAP broadcast sink so that a
user can easily follow how well the RX is working, and
for several streams.
This also adds some additional logging to better see
what we are syncing to.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>
Rename the Kconfig option from BT_ISO_ADVANCED to
BT_ISO_TEST_PARAMS to more explicitly denote that it
enables support for using the ISO test parameters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In the broadcast_audio_sink sample there are two pointers defined,
both referencing the same address. We reduce this to one pointer
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.
Rename it to random.h and get consistently with other
subsystems.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When using multiple streams the seq_num provided to the
controller would be incorrect as we used a single global
seq_num rather than a proper seq_num per stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update babblesim tests for testing chaining for advertising to ensure that
we spill over to the next PDU
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Updates the chaining for advertising.
Instead of unconditionally adding a new PDU when new data
is added we now instead fill the last PDU in the chain with
the incoming data, only adding a new PDU when there is
not enough room.
This reduces the nr. of PDUs used for advertising, and also
fixes some qualification failures
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
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>
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>
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>
Fix missing Coded PHY implementation conditional compile
causing compile error when disabling Coded PHY support in
SoCs that have radio that support Coded PHY.
Signed-off-by: Vinayak Kariappa Chettimada <vich@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>
Modify the bt_bap_broadcast_source_reconfig to use the same
parameter struct as bt_bap_broadcast_source_create so that
the two are more similar, since they both set the same values.
This allow for full control of which subgroups and stream
are updated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use the defind value, BT_APPEARANCE_WEARABLE_AUDIO_DEVICE_EARBUD,
instead of the hard coded "magic numbers".
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The sample did not properly include the source
context in the advertising data.
It also set different contexts for PACS and the advertising data
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Convert the driver to a dt-based device. Also update Kconfig so that it
depends on the right compatible being enabled, initialize in POST_KERNEL
(APPLICATION should not be used for devices) and remove one redundant
include.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
- Updated basic samples READMEs to use the new zephyr:code-sample::
directive. Dropped "-sample" suffix that's not required anymore now
that samples have their own namespace.
- Updated all references to the samples to use the :zephyr:code-sample:
role. Checked and updated the wording of said references to account
for the fact that samples should not have "... sample" in their name
anymore.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The logs were not visible when an assert fired on the controller and
`CONFIG_BT_HCI_VS_FATAL_ERROR` was not set.
Putting the logs in panic mode before entering the infinite loop fixes
that.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Remove the qos field from
bt_cap_unicast_audio_start_stream_param as it was not used.
The QOS values are set when creating the unicast group,
and not when starting the streams.
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>
This removes odd `subscribe` parameter from bt_tbs_client_discover
function parameters list. As the API user enables specific
CONFIG_BT_TBS_CLIENT_* option, the client implementation should
subscribe to the characteristic notifications so that the user receives
the value updates.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
Since the driver can now be also used on nRF91 Series, its name need to
be updated to not cause confusion.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Add `yd_esp32` board:
- Model name: YD-ESP32
- Manufacturer: VCC-GND® Studio
- Espressif module: ESP32-WROOM-32E
Signed-off-by: Julio Cesar <hi@jcsx.dev>
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>
The broadcast sink API has been modified so that all scanning, etc.
will be done by the application, rather than the stack. This commit
updates the sample to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The broadcast sink API has been modified so that all scanning, etc.
will be done by the application, rather than the stack. This commit
updates the sample to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add (optional) advanced ISO support for the benchmark ISO
sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to
be enabled in order to support the advanced settings.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add (optional) advanced ISO support for the benchmark ISO
sample. The CONFIG_BT_ISO_ADVANCED Kconfig simply needs to
be enabled in order to support the advanced settings.
This also reduces the number of default channels supported
to 1.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove virtual esp32 board and replace it with the
real word boards:
- esp32_devkitc_wroom
- esp32_devkitc_wrover (with PSRAM option)
Signed-off-by: Marek Matej <marek.matej@espressif.com>
Add two TMAP broadcast sample applications.
tmap_bms implements the Broadcast Media Sender role. It uses CAP
Initiator broadcast APIs to broadcast an audio stream.
tmap_bmr implements the Broadcast Media Receiver role. It scans and
syncs to the PA having filtered the EA by the presence of TMAP role
information. It also instantiates the VCP.
Signed-off-by: Silviu Petria <silviu.petria@nxp.com>
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>
Use the ISO Data sent callback in iso_broadcast sample to
synchronize the ISO data send. ISO Data sent callback is
generated every SDU interval corresponding to the number of
completed packets event generated by the Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Patch to rename struct bt_ots_init to struct bt_ots_init_param
to avoid duplicating the name bt_ots_init.
Fix for issue#45968
Signed-off-by: Jai Arora <infolinesoni@gmail.com>
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 fixes metadata length checks for BT_AUDIO_METADATA_TYPE_EXTENDED
and BT_AUDIO_METADATA_TYPE_VENDOR that should be at least 2 bytes long.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The CCID list can be empty, as the Assigned Numbers is not strict
regarding it's minimum length.
Fixes: #59666
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Restore back BT_CTLR_ISO_TX_BUFFER_SIZE to 251 after fix in
commit e460847b60 ("Bluetooth: host: don't fragment ISO
if len <= MTU").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Rx Prio thread stack usage value to Kconfig default
value. After long duration use of hci_rpmsg in audio
application, remaining stack was 80 bytes, hence increase
back to 448 as set in the Kconfig defaults.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
As per table 4.2 in BAP v1.0.1, the BAP unicast client shall
support at least 2 (> 1) endpoints in either direction if it
supports that direction.
Since Kconfig does not support such requirements (0 || > 1),
this is done using a BUILD_ASSERT.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This PR adds ability to build mesh with tf-m psa
for platforms those support tf-m.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
A mesh key type has been added to be able to choose the different
key representation for different security libraries.
The type as well as some functionality related to Mesh key
management has been added as a public API.
If tynicrypt is chosen then keys have representation
as 16 bytes array. If mbedTLS with PSA is used then keys are
the PSA key id. Raw value is not kept within BLE Mesh stack
for mbedTLS. Keys are imported into the security library
and key ids are gotten back. This refactoring has been done
for the network(including all derivated keys), application,
device, and session keys.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The default transport latency was not valid.
Set it to a value that is large enough.
The minimum possible transport latency is 16580 us,
but this assumes the controller ignores the RTN=2.
If the controller uses the RTN=2, the transport latency will
be slightly larger than 30 ms depending on
how the controller chooses to setup the ISO link.
Therefore, we set it to 40 ms to ensure the default
configuration is valid.
How these numbers were found:
For unframed PDUs this is defined in Core_v5.4, Vol 6,
Part G, Section 3.2.2:
Transport_Latency =
CIG_Sync_Delay + FT * ISO_Interval - SDU_Interval
Because unframed PDUs are being used, the ISO interval needs
to be a multiple of SDU interval.
If MaxPDU = MaxSDU and the PHY is 2M, this results in that
the maximum subevent size is:
2120 * 2 + 2 * 150 = 4540.
For 2 CISes this is 9080 us > 7500
Therefore, the controller has to set the ISO interval to a
minimum of 15000 us in order to fit the packets.
Based upon this info, the controller has the freedom to ignore
or use the requested RTN=2.
1. Ignore -> NSE is 2: Minimum ISO interval is 15000 us
2. RTN = 2, Increase NSE: 4 * 4540 = 18160 -> ISO_Interval = 22500 us
3. RTN = 2, Increase the FT to 2, NSE = 2 -> ISO_Interval = 15000 us
For (1):
Transport_Latency = CIG_Sync_Delay + 15000 - 7500
= CIG_Sync_Delay + 7500
For (2):
Transport_Latency = CIG_Sync_Delay + 22500 - 7500
= CIG_Sync_Delay + 15000
For (3):
Transport_Latency = CIG_Sync_Delay + 2 * 15000 - 7500
= CIG_Sync_Delay + 22500
As shown in Core_v5.4, Vol 6, Part B, Section 4.5.14,
CIG_Sync_Delay needs to be larger than or equal to the length of
all ISO events. That is, the sum of the subevents:
For (1): CIG_Sync_Delay = 2 * 4540 = 9080
For (2): CIG_Sync_Delay = 4 * 4540 = 18160
For (3): CIG_Sync_Delay = 2 * 4540 = 9080
This results in the following transport latencies:
For (1): Transport_Latency = 9080 + 7500 = 16580
For (2): Transport_Latency = 18160 + 15000 = 33160
For (3): Transport_Latency = 9080 + 22500 = 31580
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
It is not intentional to continue advertising once a connection has been
established for two reasons:
1. We do not configure enough connection contexts for this
2. We don't want to generate controller scheduling conflicts that can
possibly reduce performance.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
BlueZ btusb does not recognize hci_usb sample as Bluetooth
Controller when CDC ACM is enabled in the sample.
Refer to https://github.com/zephyrproject-rtos/zephyr/issues/29107
Signed-off-by: Vinayak Kariappa Chettimada <vich@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>
This fixes regression causing compilation errors seen when the
code is built without preset support (BT_HAS_PRESET_COUNT = 0).
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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 and use specific macros for manufacturer, product, and
serial number string descriptors.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Added Kconfig options to make HAS characteristics that has notify as
optional property selectable and thus optional. These settings are
global, meaning that a chosen notify property will be used for all
registered has instances.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
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>
After removing the high default for MCS, it was discovered that
the TBS client requires a significant amount of buffers to work
properly as well. Added the requirement as a build assert that
depends on which optional TBS client features are enabled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
strtok should not be used for the purpose it was being used for.
Furthermore, the pointer that was stored from the value is not
a long-living pointer, and would in fact be invalid after the
callback has returned.
Modified the code so that we store the value in the application
and then do a proper search for the first URI in the list.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The TMAP central had a few bugs. It was also using the old
BAP discovery API.
The commit fixes the bugs, and updates it to use the new BAP
discover API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Using EM2 or deeper sleep states (where HF clocks are off) requires
special care if BLE radio is used, since BLE radio relies on that clock,
and its power/clock requirements need to be taken into account
On SiLabs, radio PM is implemented as part of RAIL blob, which relies
on sl_power_manager HAL service. I've implemented SoC PM
state changes using sl_power_manager instead of emlib, and added
call to RAIL PM initialization in Gecko HCI driver.
Signed-off-by: Roman Dobrodii <rdobrodii@antmicro.com>
Add implementation of the Telephony and Media Audio Service, as well as
two sample applications.
tmap_central reflects a smartphone implementing the Unicast Media Sender
and Call Gateway TMAP roles.
tmap_peripheral reflects an earbud implementing the Unicast Media
Receiver and Call Terminal TMAP roles.
Upon connection, tmap_central starts an audio stream using CAP Initiator
APIs.
CCP, MCP and VCP are discovered and used to send example commands.
Future improvements: 2-earbud support, add TMAP Broadcast roles,
update with new CAP Acceptor/Commander APIs as they become available
Signed-off-by: Silviu Petria <silviu.petria@nxp.com>
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>
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@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>
Modify the BT_UUID_XX_ENCODE and BT_LE_SUPP_FEAT_XX_ENCODE
macros to use the SYS_ENCODE_LEXX macros, instead of re-inventing
the encoding.
Also apply the macros for several other places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function bt_codec_cfg_get_chan_allocation_val takes a pointer
to an enum, rather than an uint32_t, but was wrongly defined in
the header files and incorrectly used a few places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implementation of preliminary Central with multiple CIS
create support in Lower Link Layer. Uses a simple CIS
offset calculation that works when ACL are created with
connection interval that is multiple of CIG ISO interval.
Each ACLs are offset using BT_CTLR_CENTRAL_SPACING hence
having the same CIG sync delay values for all the ACLs.
Advanced Scheduling to setup CIS in any order of ACL and
CIS combination, ACL placed anywhere in timeline and CIS
creation will come therein will be implemented in later
Pull Requests.
Signed-off-by: Vinayak Kariappa Chettimada <vich@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>
Enfore a minimum duration between edges on the IRQ pin to give the HCI
controller time to detect the state change. Without this delay and with
several packets queued on the `rx_queue`, the pin could be re-asserted
almost immediately after being cleared.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Some samples, tests got missed in the switch from void main() to
int main(). Cleanup those samples/tests to use int main().
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
With the minimal C library malloc implementation moving to libc/common, all
of the related Kconfig variables have also changed. Update uses within the
tree.
Signed-off-by: Keith Packard <keithp@keithp.com>
`bt_conn_le_create` returns a signed value. Error message format string
expects an unsigned value.
This commit changes the expected value in the format string to a signed
one, to match what `bt_conn_le_create` returns.
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
Avoid hitting the assert
```
__ASSERT_NO_MSG(net_buf_simple_tailroom(buf) >= len);
```
when the provided buffer is longer than we can fit. Instead discard the
packet and log an error.
This handling is similar to packets are discarded in hci_uart
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Add a new sample that demonstrate the following points:
- Exchange of Key Material;
- Advertising encrypted data;
- Read advertising data;
- Decrypt advertising data that are encrypted.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Main now has a int return type.
Fix return values, so this sample can be compiled.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This applies the coccinelle script to another set of files:
samples/bluetooth/bthome_sensor_template/src/main.c
samples/boards/stm32/power_mgmt/standby_shutdown/src/main.c
samples/drivers/smbus/src/main.c
samples/drivers/virtualization/ivshmem/doorbell/src/ivshmem.c
samples/fuel_gauge/max17048/src/main.c
samples/hello_world/src/main.c
samples/sensor/proximity_polling/src/main.c
samples/subsys/logging/ble_backend/src/main.c
tests/drivers/build_all/mfd/src/main.c
Signed-off-by: Keith Packard <keithp@keithp.com>
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 platform nrf52_bsim was specified as an integration platform,
but was missing from the allow list.
This commit adds this platform to the allow list.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Fix broadcast audio source and sink samples' conf file to
use Broadcast ISO feature in Zephyr Bluetooth Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The init infrastructure, found in `init.h`, is currently used by:
- `SYS_INIT`: to call functions before `main`
- `DEVICE_*`: to initialize devices
They are all sorted according to an initialization level + a priority.
`SYS_INIT` calls are really orthogonal to devices, however, the required
function signature requires a `const struct device *dev` as a first
argument. The only reason for that is because the same init machinery is
used by devices, so we have something like:
```c
struct init_entry {
int (*init)(const struct device *dev);
/* only set by DEVICE_*, otherwise NULL */
const struct device *dev;
}
```
As a result, we end up with such weird/ugly pattern:
```c
static int my_init(const struct device *dev)
{
/* always NULL! add ARG_UNUSED to avoid compiler warning */
ARG_UNUSED(dev);
...
}
```
This is really a result of poor internals isolation. This patch proposes
a to make init entries more flexible so that they can accept sytem
initialization calls like this:
```c
static int my_init(void)
{
...
}
```
This is achieved using a union:
```c
union init_function {
/* for SYS_INIT, used when init_entry.dev == NULL */
int (*sys)(void);
/* for DEVICE*, used when init_entry.dev != NULL */
int (*dev)(const struct device *dev);
};
struct init_entry {
/* stores init function (either for SYS_INIT or DEVICE*)
union init_function init_fn;
/* stores device pointer for DEVICE*, NULL for SYS_INIT. Allows
* to know which union entry to call.
*/
const struct device *dev;
}
```
This solution **does not increase ROM usage**, and allows to offer clean
public APIs for both SYS_INIT and DEVICE*. Note that however, init
machinery keeps a coupling with devices.
**NOTE**: This is a breaking change! All `SYS_INIT` functions will need
to be converted to the new signature. See the script offered in the
following commit.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
init: convert SYS_INIT functions to the new signature
Conversion scripted using scripts/utils/migrate_sys_init.py.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
manifest: update projects for SYS_INIT changes
Update modules with updated SYS_INIT calls:
- hal_ti
- lvgl
- sof
- TraceRecorderSource
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: devicetree: devices: adjust test
Adjust test according to the recently introduced SYS_INIT
infrastructure.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
tests: kernel: threads: adjust SYS_INIT call
Adjust to the new signature: int (*init_fn)(void);
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove qemu_cortex_m3 from various bluetooth tests and samples since
they enable NVS which requires CONFIG_FLASH_PAGE_LAYOUT which is
not supported on qemu_cortex_m3 since there is no flash driver.
We get build failures with the arm-clang compiler because nvs.c
is referencing z_impl_flash_get_page_info_by_offs which does not
exist.
Switch to qemu_x86 as the integration_platforms if it was
qemu_cortex_m3 before.
Removed the bluetooth.mesh.mesh_shell.reduced_legacy as this was
added specifically for building on qemu_cortex_m3.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Add support for the Scan Delegator for the Broadcast
Audio Sink sample. This include advertising connectable
as well as handling PAST.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Per the BAP specification, if the Broadcast Sink role is
supported, then the Scan Delegator shall also be supported.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix RAM overflow building for direction finding feature on
nRF53 Series, by reducing thread stack sizes. And move
building DF plus CIS feature to hci_uart sample from
hci_rpmsg sample.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix RAM overflow by using default values for
BT_BUF_ACL_RX_SIZE and BT_BUF_ACL_RX_COUNT. Default Rx size
of 27 is sufficient for nRF51 SoC, as it does not support
data length extensions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We get compile warnings of the form:
error: converting the result of
'<<' to a boolean; did you mean
'((__aeabi_ctype_table_ + 1)[(byte)] << 28) != 0'?
[-Werror,-Wint-in-bool-context]
if (!isprint(byte)) {
^
Since isprint (and the other is* functions) return an int, change check
to an explicit test against the return value.
Signed-off-by: Kumar Gala <kumar.gala@intel.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>
From now app layer is able to return explicit response code and
reason that will appear in ASE Control Point notification.
Fixes issues of ASCS/SR/SPE/BI-(07/08/09)-C PTS test cases, where
PTS was receiving wrong response codes and reasons.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Add kconfig to let the ISO broadcast and ISO receive samples report
packets no more than once per set interval of packets.
Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>