Added initial CCP client implementation that simply
does discovery of TBS on a remote CCP server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Jump straight to the exit portion of the function in the case that
psa_destroy_key() failed and we set err to a non-zero value. This also
fixes Coverity CID 487701 "Code maintainability issues (UNUSED_VALUE)".
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The code shouldn't be checking for HCI command support anymore, rather in
the case of debug keys we can just start immediately using them.
Fixes commit 09e86f3b69.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The BT Host module also uses import/export PSA functions alongside the
generate one, so these PSA_WANT should be added as well.
Previously it happened to work only because Mbed TLS is enabling
IMPORT/EXPORT internally whenever GENERATE/DERIVE is set. However the
same might not be true for all PSA Crypto providers.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
The commit fixes issue where flash_area_flatten has been used where
code was only supposed to erase devices by hardware requirement prior
to write, by replacing the call with flash_area_erase and supporting
logic to select proper path.
There have been following Kconfig options added:
- CONFIG_BT_MESH_BLOB_IO_FLASH_WITHOUT_ERASE
- CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE
that are available for user depending on devices in the system and allow
to turn off paths that are not used by BLOB IO; for example if user
never writes to device with erase CONFIG_BT_MESH_BLOB_IO_FLASH_WITH_ERASE
will disable the path.
Both Kconfig options are y by default and enable all paths.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This option only exposes internal APIs, so there should be no need to allow
applications to set an explicit value. Instead, users of the API should
select it through Kconfig.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Remove the HCI command & event emulation layer for ECDH commands and
events. This means that we always do the necessary operations in the host.
The existing BT_ECC Kconfig option stays, but now gets automatically
enabled when necessary (e.g. based on the BT_SMP option), which is why this
commit removes so many explicit assignments in prj.conf files.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Fix regression in Coded PHY S2 reception to any other PHY Tx
in the s/w switch implementation.
Regression in commit 55b7dba8ec ("Bluetooth: Controller:
Refactor sw_switch hal interface use").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use the new entropy driver for 54L devices and therefore
claim BT_CTLR_ENTROPY_SUPPORT is always supported
(note 54H remains unsuported)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Let's default to this new driver.
And therefore change the conditions in the BT controller kconfig
which were selecting the native_posix fake entropy driver
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Added option to set the PACS Characteristics through the bap API,
making PACS configuration runtime available. Source and Sink PAC, as
well as Source/Sink PAC Location is can be set through a register
function in the PACS api.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Fix reset of drift_skip count when an anchor point sync was
missed so that drift compensation is applied on the next
successful anchor point sync. This will improve connection
stability for short overlapping radio event intervals.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The connection event at the connection update instant was
skipped due to previous ticker node in use that is being
stopped was registering a relative occupied time that
overlapped with the new ticker node being started for
scheduling the connection with new interval.
Added mock interface for ticker_stop_abs() hence needed by
the Controller unit testing.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
bt_gatt_find_by_uuid used bt_gatt_attr_value_handle but that
function only works to get the value handle of a characteristic
declaration, i.e. if the UUID is not BT_UUID_GATT_CHRC then it
would always return handle = 0. This meant that
bt_gatt_find_by_uuid would always use handle = 0 as the starting
handle for non-BT_UUID_GATT_CHRC attributes, instead of the handle
of the provided attr.
This was not an issue for any UUIDs that may only exist once on a
GATT server, which is most UUIDs, but for UUIDs like the
BT_UUID_TBS_* UUIDs that may be multiple instances of, it would
always return the first attribute rather than the one starting
from the provided start attr.
This commit also ensures that we do not overflow the `end_handle`
when adding 2 uint16_t values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix byteorder handling in csip sef crypto function.
On big-endian system we also need to convert the k array from
little-endian to big-endian. The Bluetooth protocol is always using
little-endian ordering.
Signed-off-by: Joakim Andersson <joerchan@gmail.com>
Align DDPI usage with nRF54L series power domains and
available DDPI configurations.
Use indices below 4 when needing to bridge with GPIO,
use indices below 8 when needing to bridge with MCU domain
like CCM and AAR; and use indices above 7 to bridge with
Peripheral domain.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace use of HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI with
HAL_TRIGGER_CRYPT_PPI; they have same value but use the
correctly named HAL_TRIGGER_CRYPT_PPI define now.
Fix conditional compile to correctly exclude reference of
NRF_CCM when CONFIG_BT_CTLR_PRIVACY=n.
Fix missing reference to CCM_TASKS_CRYPT_DELAY_BITS when
CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Peripheral for single timer use support required
for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Central for single timer use support required
for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ISO Sync Receiver for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Periodic Advertising Sync implementation for single
timer use support required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update advanced non-overlapping Central Connection Creation
scheduling for single timer use support required for nRF54L
Series SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Extended Scanning for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update Extended Advertising for single timer use support
required for nRF54L Series SoCs.
As the timer is reset on every radio end, add implementation
to accumulate the last_pdu_end_us.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This reverts commit a7fff7445c.
The next commit will re-add back the fix to primary
advertising channel plus auxiliary advertising channel too.
This will help keep the fix together regarding use of
single timer for software tIFS switching implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Restrict the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix nRF5 radio and event timer abstractions for some that
where hard coded compared to use of the ones defined in the
resources header file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add radio_sim_nrf54l.h file, which for now a copy of the
SoC radio_nrf54lx.h file. This is added for having separate
simulation model dependent timing values and specific
implementation details.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix single timer s/w switch when using DPPI on nRF53/54L
where the previous compare register index is incorrect when
the base index is a odd numbered DPPI used.
The issue is discovered as failing ISO Receiver sample with
Coded PHY and single timer use, where the compare base is
configured to use the DPPI 3 (instead of 4).
Upstream samples do not use single timer for s/w switch, the
issue is discovered when adding support for nRF54L which has
to use single timer due to the radio only having a single
timer.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit addresses two bugs in use of single timer s/w
switch implementation, incorrect aux_offset in subsequent
ADV_EXT_IND and ISO receiver failing to receive second or
greater BIS subevents.
Fix radio_tmr_start_now implementation to consider the
initial latency in starting the event timer in single timer
use mode. This fixes the incorrect aux_offset in ADV_EXT_IND
PDUs.
Fix radio_tmr_start_us implementation for single timer use,
as the timer is reset on every radio end, and hence the
requested start_us has to be adjusted for the accumulated
last_end_pdu_us value. This fixes the BIS subevent
receptions.
Also, fix the maximum radio ISR latency value used in
radio_tmr_start_us to consider the maximum Rx chain delay
and maximum radio ramp up delays. 80 us + ~30 us + ~40 us
should be able to meet the 150 us tIFS duration.
Relates to commit bcd28e0a86 ("Bluetooth: Controller: Fix
sw switch single timer for spurious TXEN/RXEN").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In current implementation, the `accept` cannot be identified if the
same one `accept` callback is passed by the upper layer.
Similar with `accept` of `bt_l2cap_server.accept`, add a parameter
`server` to the `bt_rfcomm_server.accept` callback.
Add a argument `server` to function bt_hfp_hf_accept() to avoid
building issue for HFP_HF.
Add a argument `server` to function rfcomm_accept() to avoid building
issue for shell/rfcomm.c.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In the function `bt_rfcomm_server_register()`, the channel cannot be
dynamic allocated. And only pre-set channel is supported.
Improve the function `bt_rfcomm_server_register()` to support the
dynamic channel allocation if the passed channel is zero.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The buffer `BT_RFCOMM_BUF_SIZE` is used to define the TX buffer size of
TX pool.
In current implementation, the TX buffer size of RFCOMM cannot be
calculated due to the macro `BT_RFCOMM_BUF_SIZE` is defined in internal
header file `rfcomm_internal.h`.
Move the macro `BT_RFCOMM_BUF_SIZE` form internal header file
`rfcomm_internal.h` to interface `rfcomm.h`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
BASE is now parsed on-the-fly on sink sync, removing
unnecessary restriction in intermediate parsed storage
and without requiring an excessive amount of memory.
Signed-off-by: Lars Knudsen <LAKD@demant.com>
As the connection was removed from the list, we now own its reference.
Keep this reference and return it to the TX processor.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Assert that the previous connection in the list and the tmp element
in the loop are different to the current connection.
Otherwise, if the same connection was somehow added twice it
could result in an infinite loop.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Iterate over the list of connections to find a connection
that is able to send data, instead of returning NULL if
the first connection can't send data.
This solves the problem with starvation of other connections.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
We can't use 0xff to compare with an int8_t since it'll trigger compiler
warnings/errors:
subsys/bluetooth/host/classic/br.c:397:11: error: result of comparison of
constant 255 with expression of type 'int8_t' (aka 'signed char') is
always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (rssi == 0xff) {
~~ ^ ~~
1 error generated.
Use 127 instead for situations where we don't know the RSSI value, like
when processing remote name events. This is fine since from a spec
perspective only -127 - +20 are valid values for the parameter.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Allow the user to disable the P256-M driver in case their version of
Mbed TLS does not support this driver.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Explicitly enable "PSA_WANT_ALG_ECB_NO_PADDING" to select the AES ECB
mode that it is used in CMAC operation.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>