Renames "prov device" references and options to
"provisionee" to align implementation with Mesh
Protocol specification v1.1, section 5.4.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
This is supposed to stress the host buffer and metadata handling.
It is not really testing any particular thing, ie. the pass criteria is
just that each peripheral can send and receive a fixed number of GATT
notifications without any device crashing or locking up.
Original version by Ahmed Moheib (from cloud2ground).
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Zephyr by default renews the characteristic value subscription on every
reconnection. If the ACL is disconnected in the middle of this
procedure, all the subscriptions waiting to be renewed are removed, even
if the device was successfully subscribed already.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This changes the way the GATT Client subscribes to the characteristic
value changes. The bt_gatt_write usage was replaced by dedicated
bt_gatt_subscribe API function call, so that the test verifies the GATT
Client API side as well.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add BSIM testing of GMAP, with all spec-specified audio
configuration combinations added and tested.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes missing connection reference release.
The bt_conn_le_create returns the connection object reference that needs
to be released by API caller.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add const prefix for service uuid and char uuid.
Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.
The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
The CAP Initiator and the CAP Commendar share quite a lot of
functionality in terms of discovery and performing set-based
procedures.
The code for handling most of this has been moved to
cap_common.c to avoid duplicating code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace combination of printk() to LOG_DBG() to fix the order of the
test execution logs. The printk() is printed immediately, while logs are
buffered, thus the messages from test are printed out before the stack
logs.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This verifies the zephyr host can tolerate a spec violating peer sending
ATT requests without waiting for responses.
It also tests the opposite, that is that the Zephyr host does not
pipeline requests over the air.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This removes the fixed size bt_bap_base, which provides
2 improvements:
1) The RAM usage of the broadcast sink has been reduced.
For the Broadcast Sink sample it is a reduction of 120
octets, but with much better scaling for supporting
more or larger BASEs.
2) The functions to parse BASEs now support arbitrary sized
BASEs, where they were previously restricted by our
local Kconfig options. This allow us to parse any BASE
from a remote device, without encounting memory issues.
We are still memory restricted on the devices we
actually want to sync to.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The lib was refactored, but CI didn't run the tests that used it for
some reason.
A parameter was forgotten.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adapts the `pb_remote_timeout` test to the updated `bt_mesh_suspend`
API.
Suspension is scheduled with a small delay to allow publications to be
sent before suspending Mesh.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds two test-cases; one for suspending and resuming Mesh,
and one for suspending Mesh and disabling Bluetooth before
re-enabling Bluetooth and resuming Mesh.
Both tests checks that periodic publication is stopped during
suspension.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
SIG has changed Bluetooth mesh to Bluetooth Mesh
Updating zephyr docs accordingly
Leaving out old release notes
Signed-off-by: Mia Koen <mia.koen@nordicsemi.no>
Replace hardcoded value `8` with `CONFIG_BT_CONN_TX_USER_DATA_SIZE`,
that is `8` but is going to change.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Add an extra optional input to the script which can be used
to pass more options to cmake.
Background: With sysbuild needing to pass extra options is quite
normal. Users would normally want to add options, without necessarily
wanting to change the default cmake_args, so this new options
provides that.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This header file declares the functions that rely on `bluetooth/conn.h`.
This collects `testlib/connect.h`, `conn_ref.h` and `conn_wait.h` into one.
Initial documentation for the functions in this file is also added.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The Private Beacon Client API requires a response argument to allow to
call the API in the asynchronous manner
(https://github.com/zephyrproject-rtos/zephyr/pull/56426).
Because the removal of the EXPERIMENTAL tag for this API was not
released yet, it should be OK to change this API.
The EXPERIMENTAL tag has been removed here:
https://github.com/zephyrproject-rtos/zephyr/pull/64866
Coverity-CID: 330039
Coverity-CID: 330029
Coverity-CID: 329977
Fixes#65336Fixes#65338Fixes#65354
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
the reason is that the Mesh Profile clearly stipulates that Mesh nodes
cannot change their own element definitions.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Since model struct most of member should not change at run time,
so mark as const will be suitable and safely.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This is to increase probability of reception of responses (Config Status
messages) from the node when the provisioner sends a Set message and the
node response with a Status message at the same time so that the message
collide.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Add implementation to reduce CIG's CIS retransmissions so as
to meet the Host requested Maximum Transport Latency.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added a new configuration to the BabbleSim Bluetooth Peripheral Privacy
test to cover the code path for the RPA sharing mode.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a Kconfig option that makes the RPA sharing feature optional. By
default, the Zephyr Bluetooth stack now uses the RPA rotation policy
that was active before the introduction of the RPA sharing functionality
in the following PR:
https://github.com/zephyrproject-rtos/zephyr/pull/55449
The new Kconfig option configures the advertising sets linked with the
same Bluetooth identity to use the same Resolvable Private Address in
a given rotation period. After the RPA timeout, the new RPA is
generated and shared between the advertising sets in the subsequent
rotation period.
When this option is disabled, the generated RPAs of the advertising
sets differ from each other in a given rotation period.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This adds tests for automatic security elevation and retry on security
errors. This includes two tests:
1. where the security is elevated by the central
2. the security is elevated by security request, so pairing is already
in progress.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Removed the tests for invalid bt_bap_broadcast_source_get_base
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the tests for invalid bt_bap_broadcast_source_get_id
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
PR allows to get rid of tinycrypt objects from
the final binary of the ble mesh apps based on
PSA TFM crypto.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Modified the BabbleSim test for the Bluetooth test under the
host/privacy/peripheral category. Added the RPA check in the scan
callback context of the scanning tester device to validate if the
DUT advertising address is correct.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Extended the scope of the BabbleSim test for the Bluetooth test under
the host/privacy/peripheral category. The tests ensures correct RPA
advertising after the system a reboot when the Bluetooth identities
are preloaded from the Settings subsystem.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This is the first patch with the goal of establishing a common library
for Bluetooth utilities that are commonly used for setup in Bluetooth
Host tests. The ultimate goal is to remove redundant (near) copies of
these utilities and other more ad-hoc solutions.
This patch moves one instance of testlib (from
tests/bsim/bluetooth/host/att/long_read) to
tests/bluetooth/common/testlib and makes it a proper CMake library.
The long_read test is updated to link to the new CMake library.
Further changes and de-duplication will come in later patches.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Added an additional check before failing a BSIM test
on ISO error, so that when we stop the broadcast source
(after the sink have received the expected data), lost data
does not trigger a test failure.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add an initial test based on the broadcast audio source/sink samples
which runs them together and after waiting for a predefined
amount of time, checks how many audio packets has the
sink received, and if over a threshold, passes the test.
This test can be expanded after to cover more functionality from
these samples.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update the BAP broadcast tests to use the BSIM sync API
instead of sleeps, to ensure that everything is sent
and receive correctly, regardless of timing.
Signed-off-by: Emil Gydesen <emil.gydesen@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>
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>
The test was printing one line for each packet it was sending
by default. That creates a huge log and slows things down.
Instead, let's only print those with verbosity set at 4 or higher.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Also run some split BT stack tests on the nrf5340 platform
to test this configuration.
Move the selection of which BT tests are built and run
in each platform to files in the tests/bsim/ folder.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
With TESTS_FILE the user could provide a file with a list of
tests to run.
Now we also support that file containing a mix of
tests and paths in which to search for tests.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add sysbuild build files, which allows building this test
both for the targets we could already before
(nrf52_bsim & nrf5340bsim_nrf5340_cpunet)
and also adds support for the a split build with the
nrf5340bsim_nrf5340_cpuapp.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add sysbuild build files, which allows building this test
both for the targets we could already before
(nrf52_bsim & nrf5340bsim_nrf5340_cpunet)
and also adds support for the a split build with the
nrf5340bsim_nrf5340_cpuapp.
Note that when doing a split build the controller is
taken from the hci_rpmsg BT sample, and therefore the
controller configuration in this folder is not used.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for sysbuild builds, which can be selected
by settings the variable sysbuild.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test was reusing the sim_id from an l2cap test,
which was colliding with the corresponding l2cap test
when they were run in parallel.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the HCI layer to update the channel map instead of calling directly
into the controller.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/64441
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.
Signed-off-by: Keith Packard <keithp@keithp.com>
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>
When EATT is established, the value returned from `bt_att_get_mtu` is
not useful to determine the ATT_MTU that applies to a ATT response. This
is because `bt_att_get_mtu` may return the value for a different bearer
than the request is serviced on.
To fix this, the params struct for the GATT read operation is given a
new field that will record the ATT_MTU that applies to this ATT
operation. This value is then used to determine if the GATT long read
operation is concluded.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/61741
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The test is currently broken in main and blocking
all other development when triggered.
Let's disable it by now as a provisional measure.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Adds coexistence Bsim test for Opcode Aggregator models using loopback.
The test verifies that the Opcode Aggregator server and client can send
messages to each other on the loopback interface.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Adds coexistence Bsim test for Opcode Aggregator models.
The test verifies that the Opcode Aggregator server and client can be
present and functional when operating on the same device.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Add a test for the broadcast sink that uses the BAP
Scan Delegator functionality with a Broadcast Assistant
device adding the broadcast source.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
I have seen the CI hang (both downstream and upstream) as the executable
doesn't always respond to the SIGTERM sent by `timeout`.
This will prevent that behavior. 5 whole seconds ought to be enough to
clean-up a small program.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adds Bsim test that verifies private beacon cache functionality.
The test checks that replays of the same private beacon
message is discarded.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Adds Bsim test that verifies SNB cache functionality.
The test checks that replays of the same SNB
message is discarded.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Validates that nothing nefarious happens if the application decides to
wait an arbitrary amount of time in notification callbacks.
Also validates that a disconnection during said waiting works as
expected.
E.g. in #48505, the user was trying to send data synchronously over UART
_inside_ the notification callback. Then the device was disconnected
whilst still waiting.
This kind of pattern is not recommended, but the stack should still
function correctly, stalling the "BT RX" thread shouldn't result in
state corruption or resource leakage.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
When the initiator provides CCID in the metadata, we verify
that the CCIDs exist on the device.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the BSIM test and the shell to use
bt_audio_codec_cfg_set_chan_allocation rather than implementing
their own versions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP unicast babblesim tests now does RX and TX
and verifies that the data is correctly received on both
the client and server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add validation of sending and receiving dummy data.
Previously, due to a bug, we actually never sent any data
and still passed the test.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is to increase probability of reception of responses (Config Status
messages) from the node when the provisioner sends a Set message and the
node response with a Status message at the same time so that the message
collide.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Since notice that simultaneous advertising is not only used
by relay message, provision over pb-adv can also be used.
so it was changed to a more general name.
refs:https://github.com/zephyrproject-rtos/zephyr/pull/48903
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Verify that a HAS Server IUT sends changed characteristic notifications
or indications when the Lower Tester reconnects.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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 'test_access.c', model 3 on element 1 extending model 3 on element 0
is now registered correctly. When calling 'bt_mesh_model_extend' on
models on different elements, this needs to called from the
model with the highest element index to be registered correctly.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds bsim test to verify that composition data page 1 (CDP1) is
encoded and decoded correctly.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Fixed issue when reprovisioning is done on a device with
both RPR client and server on the same device.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@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>
Added fail on pairing_failed callback for both central and peripheral.
Added pairing status checks in peripheral.
It has been done to test the case when multi-role BT device tried to
pair without bonding (peripheral role) while already previously bonded
with the same device on another Bluetooth identity as it seems that
there was an issue with it previously.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
Removed the tests for invalid bt_bap_broadcast_source_stop
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The compile script had been modified
to fully parallelize all images builds
in 1de363d9d5
And has been kept building everything in parallel since then.
Over time we have seen an increase in the number of hangs
for this job in CI.
This is understood as being the result of the number of images
having increased, leading to a too high load
on the worker machines which cause them to timeout their
connection to the github CI scheduler.
In b83a828825
these jobs priority was lowered to aleviate this issue,
but again we see an increased number of CI runner
disconnects.
Let's parallelize this compile jobs a bit less.
With this change, we do not build anymore the sets of
host ll and mesh test images in parallel but sequencially.
On a local test this reduces peak load from
~1700 to ~700, and eliminates issues with system
unresponsiveness; while there is no statistically measurable
increase in overall build time.
Note that the single audio image is still built in parallel
to the other 3 sets, as this was seen to improve total
build time by 2 seconds out of 1m51s.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Removing the babblesim testing of the invalid parameters for
bt_bap_broadcast_source_create as they are now done in a unit
test instead.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the tests for invalid bt_bap_broadcast_source_delete
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The previous ASSERT_TRUE/FALSE macros looked like
they could take extra printf like parameters but did not
(those extra arguments were just dropped).
Define 2 new macros that can take those extra parameters
and fix all uses that intended to print those extra messages.
Also add an extra "\n" as the underlaying print functions
do not add end of lines on their own.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This ASSERT_TRUE should have been an assert equal
(ASSERT_TRUE checks that the first paramters != 0)
and the condition was not correct.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The purpose of this test is to prove that the zephyr host can handle the
behavior described in the Bluetooth Core Specification Vol.3 Part.F
3.3.2 "Sequential protocol".
The host should be able to handle all of those in parallel: one
indication, one write request, multiple commands and multiple
notifications.
The "tester" part had to be written with a "tiny host" implementation
instead of the Zephyr host, as the ZH conflates GATT client and server
and doesn't allow a device to enqueue an ATT request + an ATT indication
on the same bearer.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Removed the tests for invalid bt_bap_broadcast_source_reconfigure
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a simple central and peripheral CIS test that
exercises the ISO host API for unicast ISO (CIS).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Previous commit reverted the `link_encrypted` filed of CCC config.
Update the test to match the new expected behavior.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Test that SC Indication is correctly sent when the client reconnect and
the server updated the GATT database since last connection. Test that
the indication is sent even if the bond is not restored.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Added retry mechanic to CSIP notifications by adding them into system
workqueue. Bookkeeping is done for notifications for all clients, and
potentially disconncted clients will also receive notifications on
reconnect. This also adds mechanic to restore the local clients list
upon registration of the service, as well as BSIMs to test notify on
reconnect.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Reduce the unnecessary hidding and indirection,
as it makes the scripts more difficult to follow
for no benefit.
If somebody wants to debug these tests, they'll want
to see the sim_id, and won't benefit from going around
opening files needlessly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fix the print format string so the "%" is printed
instead of a bogus value.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for reading and writing long values (> MTU)
when using the CAP API.
This change does make it slightly slower to execute the
CAP procedures as it is now done on a one-by-one basis,
which affect multi-ACL setups, but that also means
that the buffer requirements for CAP will generally be lower.
There is still room for improvement as we can perform the BAP
operations in parallel on each ACl, which should return this to
its former performance.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Expand the CAP tests to also discover and setup a source
stream, so that the CAP procedures are run on multiple
streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The purpose of this test is to verify that the stack has
the correct behavior if the ACL disconnects while one or
more streams are in the streaming state.
The main point it validates is that unicast server device
can restart advertising using a simple k_work in the
disconnected callback.
The number of connections supported by the test suite has
also been reduced to 3, to avoid some seen issues with
scheduling when CONFIG_BT_MAX_CONN=5.
A part of implementing the test for this purpose, the
unicast client and unicast server have been extended
to also advertise and scan for proper ASCS advertising
data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the tests to use bt_le_scan_cb_register and the "new"
scan callback, as that is better suited to handle extended
advertising.
Signed-off-by: Emil Gydesen <emil.gydesen@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>
Removed the tests for invalid bt_bap_broadcast_source_start
parameters and state, as those tests now implemented as unit tests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove unused code in `host/gatt/settings` test. The conditional block
could never be reached because the type of the discovery parameter is
`BT_GATT_DISCOVER_CHARACTERISTIC`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Adjust test sleep durations to compensate towards timing
changes in Zephyr Controller radio scheduling.
With the change in the radio scheduling, there is overlap
of advertising PDU from multiple nodes that relay the PDU,
hence increase test timeout so that next advertising
interval that uses random delay will get received by nodes
without collisions on air.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This adds support for the Upload OOB Start message to the DFD server, by
providing callbacks that the application can use to hook any OOB scheme
into the model behavior.
There are also extensive changes to the dfu_slot module, to accomodate
the new needs that appeared with the support for OOB transfer (mainly,
fwid, size and metadata are no longer available when the slot is
allocated, they appear later in the handling).
Signed-off-by: Ludvig Samuelsen Jordet <ludvig.jordet@nordicsemi.no>
This patch amends the existing L2CAP accept callbacks to use the new
accept signature that includes a pointer to the L2CAP server structure.
Signed-off-by: Donatien Garnier <donatien.garnier@blecon.net>
Split FW into two images, one for central one for peripheral.
The SoftDevice controller's connection contexts are not role-agnostic:
some are reserved for the peripheral roles some for the central roles.
Splitting the test into two images is anyway "The right thing (TM)",
it's just that we sometimes take the shortcut of using a single image to
go faster.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adds testing of composition data page 2 and 130 in the
mesh_prov_pst_pb_remote_ncrp bsim test.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Added a BabbleSim test to check the update of the destination address
of all active connections during the identity resolution operation.
All connection objects associated with the same private peer address
should convert it to the identity address.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.
The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);
has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);
The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.
All in-tree uses of the function have been adapted.
Fixes#61888.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Rename BT_AUDIO_CODEC_QOS_[UN]FRAMED to
BT_AUDIO_CODEC_QOS_FRAMING_[UN]FRAMED and give a name
to the enum, which is then used by the
struct bt_audio_codec_qos.
The rename was needed as we had a codec_qos initializer of the
same name, so the values were renamed to avoid duplicated
macro names.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
bt_l2cap_chan_send returns the total bytes sent from the buf,
hence test should only fail when it returns a negative error code
and not a positive number of bytes sent.
Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
Fix a bunch of mismatched CONTAINER_OF, few missing
k_work_delayable_from_work conversions but also many
bt_l2cap_le_chan/bt_l2cap_chan and few others.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
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>
Added a BSIM tests for PACS notification functionality. This test
tests that all optional notifies are working, as well as verifying
that a disconnected subscribed client will be notified on reconnect.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
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>
DFU slot sequence depends on the settings backend.
Commit adapts test after changing bsim settings backend.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Commit adds using BabbleSim's settings backend instead of
proprietary one that is based on POSIX files.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
PSA ITS settings area does not belong to Bluetooth.
It should be restored before Bluetooth persistent data.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
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>
Commit adds configuration for mesh with mbedtls PSA
to CI BabbleSim tests as well as emulation of
the Internal Trustable Storage(ITS) based on Zephyr's
settings to run in parallel environment.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Test fixed group address acceptance condition, which has been clarified
in Mesh Protocol 1.1: A node shall deliver a message to the model
subscribed to a fixed group address even if the corresponding feature
is disabled.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
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>
Time between the start of 2 consequtive advertising events consists
of advertising interval and delay. If delay is zero and the measured
interval is the interval between the last or prelast packet and the
first packet of the next adv event, the measured time can be less than
adv interval.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
According to section 4.2.2.4, Compositiion Data page 128 shall be
present if the node supports Remote Provisioning Server (section
4.2.2.4).
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@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 tests to use this updated API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This will effectively test both the BAP and CAP TX sync functions
as well as the CAP send function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Since 3a197934fc
main() should be int main(void) instead of void main(void)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Since 3a197934fc
main() should be int main(void) instead of void main(void)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Since 3a197934fc
main() should be int main(void) instead of void main(void)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>
Extended the ISO broadcaster BSIM test with an additional
step to create a BIG using the test parameters.
Since this isn't properly implemented in the controller,
CONFIG_BT_ISO_ADVANCED has not been enabled in the
prj.conf yet.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor the test function to split it into multiple
smaller functions. This makes the main function much shorter
and easier to follow, and allows reusing of the individual
steps.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>
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>
Added test for the bt_conn_set_bondable API function.
Check if we can pair without setting the bonding flag on the
per-connection basis if the device was already bonded on the
other identity.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
Mesh 1.1 specification extended static OOB authentication
value till 32bytes. PR adds one more test vector in
provisioning bsim test to check it.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The device privacy test was using the wrong value for the advertising
data.
To fix the error, the test now use the `BT_DATA_BYTES` macro to create
the `bt_data` structure.
Also use `BT_DATA_NAME_COMPLETE` instead of the raw value.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
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>
The bt_bap_scan_delegator_find_state did not properly return the
correct receive state due to confusing return value of the
iterator function.
Modify it to use a simple bool.
This fixes all issues with "Failed to find receive state for sink"
when using the Broadcast Sink.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This change ensures that openthread network topology will be formed
properly, by delaing start of echo client application.
Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
Don't assume the connection handle will always be 0. This is currently the
case with the Zephyr link layer, but recently changed in the Softdevice
Controller.
Another problem is that apparently the spec allows the controller to just
blackhole data instead of returning `BT_HCI_ERR_UNKNOWN_CONN_ID` if the
host uses a wrong handle.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Test that LPN correctly sends Friend Subscription List Add and Remove
messages to Friend when subscribed and unsubscribed to virtual addresses
wirth collision.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Test that transport layer correctly encrypts and decrypts messages to
virtual addresses with collision.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Test that:
- virtual addresses in subscription list and publication states are
stored and restored correctly
- virtual addresses with collisions are stored and restored correctly
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit adds the following features related to virtual addresses
support:
- Allows to store Label UUIDs which virtual addresses collide;
- Allows to decrypt messages encrypted with a virtual address with
collision;
- Allows to publish a message to a specific Label UUID to avoid virtual
addresses collision by adding a pointer to Label UUID to
struct bt_mesh_msg_ctx and struct bt_mesh_model_pub;
- Allows to differentiate Label UUIDs in the model's Subscription List
by storing all subscribed UUIDs in struct bt_mesh_model.uuids field.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@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>
This fixes the failure to use a resolvable private address in this
scenario.
1. call `bt_le_oob_get_local`, will generate and mark RPA as valid
2. start connectable adv w/ IDENTITY bit
3. start connectable adv w/o IDENTITY
4. RPA is not set (in `bt_id_set_private_addr`) because RPA
is still marked as valid
When EXT_ADV is enabled and the controller supports it, a different code
path is taken that doesn't have this issue.
Unconditionally invalidating the RPA when starting advertising works around
this issue.
Fixes#56326
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add BabbleSim test to make sure data can be sent immediately upon
connection from the L2CAP channel connection callback
Signed-off-by: Donatien Garnier <donatien.garnier@blecon.net>
Add a new BabbleSim test checking that the value of the Bluetooth
identity stored in the settings is correct.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:
- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h
Fixes#58214.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Typically the client is the first device in our babblesim tests, so
reordered the initiator and acceptor for the CAP tests to conform to
that.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add test of the unicast audio cancel that can cancel any pending
procedures. This is done by adding a new blocking behavior in the
cap acceptor.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Split the cap_initiator_test.c to two new files
cap_initiator_broadcast_test.c and
cap_initiator_unicast_test.c as the two barely had any
common functionality, and the file was getting too large.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix BIS test for ISO Tx Buffers in Controller to be 2 for
ISO TX MTU size of 502 bytes.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Check that if a bonded peer subscribed to a CCC, a non-bonded peer with
the same address cannot update the CCC.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from tests. 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>
Update `ccc_store` bsim test to remove the 'expected failure'. The issue
being fixed in the following commit.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The first test check that if a bonded peer subscribe to a CCC, this
change is correctly stored to flash.
The second test, which is currently failing, is included to reproduce a
bug that occur when CCC or CF store on write is disabled and the other
one is enabled, leading to the delayed store being enabled. Causing the
value of the corresponding `n` selected option to not be stored at all.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add iterations to test_cap_initiator_unicast so that
we test starting again after stopping, as well as recreating
the group.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This set tests if Private Beacons are advertised properly, with address
changed for every beacon and Random value changing appropriately
regarding the scenario (IV Update, Key Refresh, advertisements on device
with friendship support) and Random Interval state.
All tests contain two devices: tx advertises Private Beacon (has Private
Beacon Server in composition) and rx sets Private Beacon state on tx
device (has Private Beacon Client). On rx device, scan callback is
registered to monitor Private Beacon advertisements.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
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 notifications ASE notifications
by doing a long read if the notification has length of
the maximum MTU.
This behavior is currently not defined by the BAP spec,
so may not work with all devices.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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>
A recent change in MCS significantly reduced the requirement
of L2CAP_TX_BUF_COUNT and should now work with any value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Test timeout of Remote Provisioning procedure when provisioned device
is unresponsive. Test covers two cases: unresponsive unprovisioned
device, which causes timeout on RPR Server and unresponsive RPR Server,
which causes RPR timeout on RPR Client.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>