This fixes setting invalid List_Item_Length in Current Calls List.
The fix complements 9c7ef8e.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This was recently refactored (in #58440). But it introduced a bug in which
some channels were connected but not the whole list asked for by the peer.
In that case, `result` will not be `SUCCESS` but we still want to call the
`connected` callback as the peer will consider those channels to be
connected when we send the response.
The symptom is that EATT channels are being instantiated, but not
considered connected (ie. usable by the stack).
Also introduce a test that has asymmetric channel resources (5 on central
vs 2 on peripheral) to reproduce the bug.
Fixes#60212
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Make `bt_eatt_count()` return what it says on the tin, ie. the number of
channels that are actually connected.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add support for setting advanced broadcast ISO parameters
using the ISO test commands. This allows the host to set
ISO parameters that the controller normally would handle.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for setting advanced unicast ISO parameters
using the ISO test commands. This allows the host to
set ISO parameters that the controller normally would
handle.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Nordic Semiconductor has been testing the feature extensively on its CI.
The tests includes the sample data and the PTS tests.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
These configs are very tied to the BT_LL_SW_SPLIT implementation,
so it makes sense that these are only visible when that link layer is
used.
For the ones that may be used by other controllers in the future,
a dependency has been added.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Truncation of advertising data has to be done at a PDU
boundary; Including only part of a PDUs advertising data is
not allowed
Signed-off-by: Troels Nilsson <trnn@demant.com>
If the aux scanner already has CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX
advertising data, there is no point in following an aux ptr -
instead flush the data and produce an incomplete report
Signed-off-by: Troels Nilsson <trnn@demant.com>
Allows the application to force the use of an NRPA.
This is applied regardless of any other roles running (ie scanner) or
advertising type.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Increaing mesh scan window in order to reduce the number
of messages colliding into scan window end which happens
every 30ms currently. Increasing the window to 3000ms in
order to improve performance.
Keeping 30ms window only for legacy advertiser support.
Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
This fixes missing `static` function specifier.
The bt_att_chan_create_pdu is not called outside of att.c.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Updates the handling of incoming seg ack messages to comply with
the mesh protocol specification, section 3.5.3.3.2 and section
3.5.3.3.3.
Previous implementation did not restart the retransmission timer unless
the incoming ack contained at least one segment newly marked as
acknowledged. According to the spec, the timer should be restated
regardless. The implementation depends on the retransmission
timer to end the transmission early if there was no more retransmission
attempts. Checks have been added to ensure that this now happens
immediately.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
In discover_next_instance coverity did not consider the
ASSERT and warns about possibly dereferecing current_inst
which could be NULL. Modifed the code slightly to make
Coverity happy.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The Codec Specific Configuration Parameters provided by server was
not copied at bt_ascs_config_ase. Detected by PTS in BAP/USR/SCC PTS
test cases, because no LTV values appeared in ASE Codec Configured
notification.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Updated SAR default values to align with the latest mesh 1.1 drafts,
and relevant Bsim tests.
Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
Modified bt_cap_stream_ops_register to always register BAP callbacks
to ensure that the callbacks are always forwarded (unless later
overwritten by the application...)
The CAP Initiator Unicast will still register the callbacks itself,
to ensure that the unicast procedures still work even if
bt_cap_stream_ops_register was never called.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When a CIS is established for the peripheral, then not all
QOS values are completely valid as they are simply missing
from the CIS established event. This commit updates the
missing fields based on the QOS settings provided by the
BAP Unicast Client during QoS Configuration of the endpoint.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>
This improves the code readability and reduces flash usage a bit by
spliting up GTBS from other TBS instances in bt_tbs_server_inst
structure, so that some of the code could be conditionally compiled
out.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds handling of ASE control point operations in separate thread
so that the notifications of ASE state changes are sent from non-BT
thread. This ensures bt_gatt_notify_cb to be blocking waiting for
available buffers to send the notifications.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add CAP shell commands for starting specific audio configurations
based on the BAP specification.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit adds missing tx power config options for nRF53x SoCs, as
well as the missing Radio defines for nRF53x SoCs.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
Adds callback API for the following config client status messages:
- Composition data status
- Model publication status
- SIG model subscription list
- Vendor model subscription list
- Netkey list
- Appkey list
- SIG model app list
- Vendor model app list
- Key refresh status
- Heartbeat publication status
- Heartbeat subscription status
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
The BAP stream object should not have a dir field. The
dir field should be stored in the EP only (to avoid having two
fields storing the same value, causing possible issues).
The field was removed, and the places that use it has been updated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for transmitting on multiple streams, e.g.
with the simple `send` command or with the sine generator.
This extends the start and stop sine to take a "all"
paramter to start sending on all streams.
This also fixes an issue with the seq_num when multiple
streams are transmitting, since the timing may get delayed
which then delays the seq_num which are then scheduled too late.
The fix here is to only use the timer for the inital sequence
number when starting to send the sine way, and then increment it
per TX.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some controllers support additional connection parameter ranges
beyond what is described in the specification. Enabling this new option
allows the application to set any value to all connection parameters.
Tbe Host will perform no limits nor consistency checks on any of the
connection parameters (conn interval min and max, latency and timeou).
However, the Host will still use numerical comparisons between the
min and max connection intervals in order to verify whether the
desired parameters have been established in the connection.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This fixes invalid memset of QoS parameters that may happen if Config
Qos operation is requested on ASE in QoS Configured state. In such case
if the requested parameters have been rejected, the ASE QoS parameters
shall remain unchanged (were memset instead). Otherwise, the stack shall
send QoS Configured state notification with cleaned up parameters (all
zero's) which was not done.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Fixes erroneous packing/unpacking of model app list messages
in the configuration client and server. According to the mesh 1.1
protcol spec (4.3.1.1) two app indexes shall be packed in a 3 octet
interleaved format. The current implementation packs them in 4 octets.
This commit also provide a helper function for unpacking key indexes
as public API to facilitate future config model callback API.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Adds a comment stating the state of the peripheral SDU size
and why it is being assigned the PDU size on CIS established.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
According spec, for the same iv index, iv update flag
should trans to false, when iv update procedure complete.
When local environment has attack-node
to store old network beacon(1,1), and re-send same
network beacon(1,1) after 192hours, will cause whole
bluetooth mesh network broke.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
OOB information should be in little endian in scan report messages.
URI hash should be retrieved as it is from unprovisioned device beacon
and encoded likewise into scan report messages like we do for UUID.
Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
This fixes possible ASE leak in bt_ascs_config_ase in case
ascs_ep_set_codec function returns an error.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This removes code duplicates.
ASE Disable operation handler has been refactored by providing the
`rsp` pointer as one of the function parameters. ascs_cp_rsp_add is
not called from ase_disable explicitly, so the contents of the
response buffer are not changed in case the ase_disable is called
from non control point context.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This removes code duplicates.
The ASE Release operation handler has been refactored by moving the state
validation check to the ase_release function body and providing the
`rsp` pointer that is later filled. ascs_cp_rsp_add is not called from
ase_release explicitly, so the contents of the respons buffer are not
changed in case the ase_release is called from non control point context
e.g. `disconnected` callback.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This moves copying of parameters after application return value
validation so that the metadata is not stored if rejected.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>