bt_conn_le_create logs a warning if the provided conn is
non-NULL which was the case here. Simply set it to
NULL as it is a local variable.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add implementation for Extended Advertising Auxiliary PDUs
to use ticks slot window feature.
This will allow the periodic scheduling of AUX_ADV_IND PDUs
to drift upto 10 ms advertising delay minus the ticks_slot
time reservation of the AUX_ADV_IND PDU when overlapping
with other states/roles that cannot be moved around, to
avoid skipping them.
Having an active Extended Advertising simultaneously with
an ISO Synchronized Receiver or Connected ISO connection
will now have less ISO SDU loss when using 10 ms ISO
intervals.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Introduce ticker reschedule with drift so that role like
AUX_ADV_IND can start after overlapping states and roles
using time reservations.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix to reschedule before overlap and be collision resolved
in the next periodic interval for tickers using slot window
yield.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove the deprecated HCI driver API which was provided by the hci_driver.h
header file. The deprecation happened in Zephyr 3.7, so the API can now be
removed for Zephyr 4.1.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This commit changes the BSIM tests to use the same recv callback
for all tests. The purpose of this is to reduce code duplication
and make it easier to maintain the tests.
This also changes the recv_cb so that in case of any error we log
the most recently received SDU, which should provide more
information about why a test failed in case of RX error.
PBP had to be updated a bit to support the audio_stream
struct.
Also modifies a check and log in bap_stream that was less than
helpful to determine if it was the stream or the endpoint that
was NULL.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Aligns subnet bridge related commands according to conventions used for
rest of the shell commands. Also updates documentations to reflect the
change.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
TASK_SHUTDOWN was deprecated in newer SOCs and now removed
in MDK 8.68 (nrfx 3.9.0)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Change the select to a depends on for the Kconfig options
for HAS and HAS_CLIENT.
This is an effort to reduce the number of selects used by
LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change the select of BT_PER_ADV_SYNC and BT_EXT_ADV to
depends on. This is an effort to reduce the use of
select for Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify ASCS and BAP Broadcast sink to depend on the PAC options
instead of selecting them.
Since Kconfig does not support "depends on X if Y",
a select for PAC_{SRC,SNK} is used depending on
ASCS_ASE_{SRC,SNK}.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP Kconfigs option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP_BROADCAST_SOURCE Kconfig option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the selects and use def_bool for BT_AUDIO_RX and
BT_AUDIO_TX.
This is part of an effort to reduce select in Kconfig.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the Kconfig options to depend on the GATT
features rather than selecting them.
This is part of an effort to reduce the amount of
selects we use in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the selects from BT_BAP_UNICAST_SERVER and BT_BAP_UNICAST_CLIENT
and use a def_bool for BT_BAP_UNICAST.
This is part of an effort to reduce select in Kconfig.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
As long as MBEDTLS_ENTROPY_C is enabled, Mbed TLS needs to
poll some entropy source to gather data that will then be
processed by CTR/HMAC-DRBG modules. This means that in most
of the cases, once MBEDTLS_ENTROPY_C is enabled then also
MBEDTLS_ENTROPY_POLL_ZEPHYR needs to be enabled. This was
done manually until now, as the long list of samples/tests
demonstrate.
This commit solves this dependency by defaulting
MBEDTLS_ENTROPY_POLL_ZEPHYR to on as soon as
MBEDTLS_ENTROPY_C is set. As a consequence, all manual
enablement of MBEDTLS_ENTROPY_POLL_ZEPHYR in samples/tests
are removed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Adds support for using relay buffers and advertising set for the subnet
bridge feature, even if the relay feature is disabled.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
When start to sending proxy advertising, will also process in
send_pending_adv, but the bt_mesh_adv_get_by_tag will directly return
buffer from bt_mesh_adv_queue or bt_mesh_relay_queue, which case
mesh messages sent on different sets, can cause peer replay attack.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Remove unnecessary include in header and source file.
gmtime_r() is an extension to the C library, and therefore one
needs to explicitly ask for its prototype to have it exposed.
This is done by defining _POSIX_C_SOURCE so let's do so.
These two changes fix build errors with some libCs.
Tested with pico, newlib, minimal and the host glibc.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This patch defines the message format for AVCTP unit message.
This is the first out of the four types of commands and can be
used by the CT to obtain the unit info from the TG device.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Only the basic functions for establishing an AVCTP connection
are provided at this stage.
An BR/EDR ACL connection is necessary before AVRCP function.
Register callbacks before utilizing AVRCP.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch add SDP records for both CT and TG role.
The SDP attribute would be registered according to the configuration.
OBEX and Browsing commands are optional and yet not supported.
SDP registration is implemented at AVRCP level to simplify the
workload of the upper layer. We assume the App can have limited
knowledge on SDP structures.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch implementing avrcp.c
New Kconfig BT_AVRCP is provided to enable this layer.
BT_AVRCP_TARGET and BT_AVRCP_CONTROLLER are then
provided to enable one of the two roles independently.
avrcp.h shows the APIs for the upper layer.
Only connection and disconnection interfaces are provided in this patch.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch implementing avctp.c
New Kconfig BT_AVCTP is provided to enable this layer.
avctp_internal.h shows the APIs for the upper layer, i.e., AVRCP.
Only connection and disconnection interfaces are provided in this patch.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This fixes#78721 which was introduced in PR #44686, which changed (and
renamed) `adv_new_legacy`/`adv_get_legacy` to return an existing
`bt_dev.adv` if it existed. This caused a problem, where the existing
adv then would be used to start advertising, and if this fails (because
the adv is already advertising, for instance), `bt_le_adv_start` would
erroneously delete the adv, making the host lose the context for the adv
which still is advertising.
Before PR #44686, this would not happen, because `bt_le_adv_start` would
return early when `adv_new_legacy` returned `NULL` and never reach the
delete call.
I have refactored this to make responsibilities a bit more clear:
`adv_create_legacy` now does 1 thing: create an ext adv and assign as
the legacy advertiser. This mirrors `bt_le_adv_delete_legacy` which does
the opposite. I have implemented error codes to match the behavior that
PR #44686 was made to implement.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
Changes the implementation of `bt_gatt_is_subscribed` to use the
attribute read method instead of casting the user data pointer when
extracting the CCC Attribute Value.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Refactors `bt_gatt_is_subscribed` by changing a CHECKIF to an if
statement to avoid undefined behavior if CHECKIFs are "disabled".
Uses sizeof(a uint8_t) instead of 1 to avoid magic numbers.
Initializes `properties` to 0 to avoid undefined behavior.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Update FAE table type from array of uint8_t to int8_t. From Vol 6.0,
Part B, section 2.4.2.52: "The ChFAE field contains the per-channel
mode-0 FAE table of the local Controller. Every per-channel mode-0
FAE value is represented by an 8-bit signed integer"
Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
Obviously, everyone knows that there are 8 bits per byte, so
there isn't a lot of magic happening, per se, but it's also
helpful to clearly denote where the magic number 8 is referring
to the number of bits in a byte.
Occasionally, 8 will refer to a field size or offset in a
structure, MMR, or word. Occasionally, the number 8 will refer
to the number of bytes in a 64-bit value (which should probably
be replaced with `sizeof(uint64_t)`).
For converting bits to bytes, or vice-versa, let's use
`BITS_PER_BYTE` for clarity (or other appropriate `BITS_PER_*`
macros).
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
To ensure payloads are delivered in time for the first subevent
in framed BIS, ISOAL now enforces a (configurable) margin of
the calculated time offset
Without this margin, it has been observed that a broadcaster
can end up consistently missing the first subevent in every third
event in a 7.5 ms ISO with a 10 ms SDU interval
The margin is a conservative 2 ms by default, but can likely be
set a lot lower for most implementations and HWs
Signed-off-by: Troels Nilsson <trnn@demant.com>
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.
This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).
Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add `len` to store the result of `strlen(addr_arg)` to avoid
multiple calls to `strlen` within the `for-loop` in
`cmd_scan_filter_set_addr`.
While the performance impact may be minimal in a shell context,
storing `strlen(addr_arg)` in `len` ensures a single call,
making the code more predictable and consistent.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
In case of conflicts when calling bt_id_find_conflict
there was no way to easily determine what conflicted.
This is a rare occurance, but has happened when testing
against PTS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>