The code was a bit hard to read. From what I understood, the intent is
to not send the PHY update if we are already on 2M symmetric.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This commit adds a KConfig option and an API to set the interval in
which chunks get send, in milliseconds.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
Replace boolean flags with atomic.
This also properly add guards for the multi-device procedures
and reduce the number of places where the busy flag is set.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the MICP client implementation.
This also adds a missing check for the discovery procedure.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the implementation.
The discovery procedure is also now properly guarded with it
so that in case that any procedure is currently in progress
for the specific connection, then a new discovery procedure
cannot happen until all other procedures are finished.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rework comment text for FAKE_ENTROPY_NATIVE_POSIX used as
entropy driver for the Controller on BOARD_NRF54L15BSIM.
Relates to commit 34b6b3d9eb ("Bluetooth: Controller:
Support FAKE_ENTROPY_NATIVE_POSIX").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Mbed TLS automatically sets PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
whenever "_IMPORT || _EXPORT || _GENERATE || _DERIVE" operations
are set. Therefore we just set the proper actions where required.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the MCC implementation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the GMAP client implementation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added option to set the ASE count through the bap API, making ASE
configuration runtime available. The upper limit of ASEs are still
bound by the Kconfig options set for ASEs.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
`conn_auto_initiate()` starts a bunch of controller procedures (read: HCI
commands) that are fired off right after connection establishment.
Right now, it's called from the RX context, which is the same context where
resources (cmd & acl buffers) are freed. This not ideal.
But the procedures are all async, so it should be fine to schedule this
function on the system workqueue, where we have less risk of deadlocks.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Check the remaining buffer length is not less than
required data length before pulling data from the
buffer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
There's a generally available bt_hci_get_ver_str() function, so use that
instead of defining our own.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.
Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add support for use of FAKE_ENTROPY_NATIVE_POSIX as entropy
driver for the Controller on BOARD_NRF54L15BSIM.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add to_str functions for context, parental rating, active state,
codec cap freq, codec cap frame duration,
codec cap channel count and location.
The remaining values are just numeric values and does not
need a to_str function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function took the uri as a `char *` but is in fact
not a null terminated string so change the type to uint8_t *.
Add a check fro uri_len == 0 before doing uri_len - 1
Changed the found check to just check the first octet rather
than the more costly strlen.
Fixed the type of the iterator
Add a break in the loop as we only need to find one ":"
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix scan_update() implementation for missing flags clear
that prevented starting scanning after previous attempt to
start failed due to parameters being rejected by the
Controller.
Example, attempting to start coded PHY scanning with a
Controller implementation that does not support it can fail,
but attempting again without coded PHY scanning should
succeed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The TBS client callbacks are just informative so we
provide the information to multiple listeners.
To support this for the long strings, the function
handle_string_long_read was refactored.
This also allows for multiple users of the TBS client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the encrypt state was changed via
bt_bap_scan_delegator_mod_src then we didn't set the bad
broadcast code correctly.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function had marked the type as char *, but it was in fact
not a string but rather a uint8_t array.
Marked the type properly and added a cast when using it with
bt_tbs_remote_incoming.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CAP commander used bt_audio_valid_ltv which required
BT_BAP_STREAM to be enabled, but the CAP Commander does not
need BT_BAP_STREAM to be enabled.
Moved the function to audio.c which is always compiled for
the CAP Commander, thus removing the requirement for
BT_BAP_STREAM and the accompanying bt_bap_stream.c file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The UTF8 implementions for both client and server
both use the utf8 API which require CONFIG_UTF8.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function had marked the type as char *, but it was in fact
not a string but rather a uint8_t array.
Marked the type properly and added a cast when using it with
strings.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the CAP stream callbacks so that the application
callbacks are called before the CAP initiator.
This allows the application to abort/cancel a procedure
before we send out any future request.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace several bools in bt_aics_client with an atomic value.
Update how these values are modified so that we can better
prevent race conditions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When calling bt_cap_initiator_unicast_audio_start on a set of streams
that are all in the streaming state we return early with -EALREADY.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This allows the procedure to work for streams in the non-idle state,
e.g. we can start one of more streams in the codec configured
or even enabling state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This allows applications to modify the values set by an
existing unicast group, assuming that none of the streams in
the CIG has been connected.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Behaviour is unchanged for max_skip == 0
For max_skip > 0, use a slightly different calculation to ensure
we can pass LL/DDI/ADV/BV-28-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
Ignores "command disallowed" if the host privacy implementation tries
to change the device's random address while scanning or initiating.
This is not allowed by spec. It's caused by scan_update() in scan.c.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
CONFIG_SOC_COMPATIBLE_* is not configurable but CONFIG_BT_LLL_VENDOR_* is.
This allows an alternate LLL to be built on nordic and OpenISA chips.
Signed-off-by: Félix Piédallu <felix@piedallu.me>
The logs for retransmission attempts for sending segments and ack
retransmission attempts for receiving segments were the same, making it
difficult to distinguish between them. This can be solved by adding
information to the log of ack retransmission.
Signed-off-by: Junho Lee <tot0roprog@gmail.com>
The `bt_id_set_adv_own_addr` function itself tries to allocate a buffer
for the command and it failes due to lack of buffers, it returns error.
However, the `le_ext_adv_param_set` function doesn't handle the error
properly and keeps its own allocated buffer.
This commit releases the allocated buffer.
Partially fixes mesh in #77241.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Implemented new DIS characteristics:
- UDI for medical devices
- IEEE 11073-20601 Regulatory Certification Data List
- System ID
Also fixed buffer overflow bug when assigning too long DIS string literals
Signed-off-by: Simen Eilevstjønn <simen.eilevstjonn@laerdal.com>
Rename `BT_CONN_AUTO_FEATURE_EXCH` to `BT_CONN_LE_FEATURES_EXCHANGED`,
and add some comments for readability.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Use SW_SWITCH_SINGLE_TIMER for nRF54Lx so that fast ramp
can be used, and hence support assymmetric PHYs in ACL
connections.
nRF54Lx radio domain does not have second timer instance
to efficiently implement software switch unless a second
time is used from a different power domain needed use of
PPIB for the double buffered switch timer compares.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use NRF_GRTC, Global real-time counter, instead of NRF_RTC.
NRF_GRTC is present in a different power domain in the SoC.
Also, NRF_GRTC provide microsecond resolution timing units,
in the future use of NRF_TIMER for packet timer can also be
replaced.
Use of NRF_RTC would keep Radio power domain ON in addition
to already ON NRF_GRTC's power domain, hence switch to using
NRF_GRTC on nRF54Lx SoC to have lower power consumptions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>