Some of the CSIP tests take a while to run given the number of
devices, and some of them started to fail in CI because of a
timeout, so we increase the EXECUTE_TIMEOUT a bit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
[Description]
tests: shell: Restart bt will register the same connection callback twice.
Callback next node point to itself, when link established callback function
loop infinitely.
[Fix]
Unregister the previous callback to avoid register repeatedly.
[Test]
After bt init/disable times, create connection successfully.
Signed-off-by: huajiang zheng <huajiang.zheng@nxp.com>
Where extended advertising is restablished through the use of
recycled() callback, registers over bt_conn_cb_register().
Signed-off-by: Luis Ubieda <luisf@croxel.com>
bt_pbp_parse_announcement was defined as uint8_t return value function,
but returned errno values, so it was modified to return an int instead.
The return values are also now more granular and documented.
The function also triggered a coverity issue with the way that it
parsed the data->data, as it would be marked as tainted. This should
be fixed by using the net_buf_simple API, which also improves on
some other parts of the code.
Finally the meta argument for the function was changed from an
unknown sized buffer, where the caller somehow had to know the
size of the metadata before calling the parsing function, to
an output pointer. This also omits the requirement for the
caller to always copy the metadata, where now it just
gets a pointer to the metadata in the bt_data struct. The application
can now always decide whether to continue to parse the metadata or
to copy it, using the pointer and the return value of the function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use the kconfig option COMPILER_WARNINGS_AS_ERRORS instead
of passing the compiler option directly to the build.
That allows us to do whatever needs to be done in cmake to ensure
warnings are treated as errors.
Also handle better options and paths with spaces on them.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Minor fixes in this test script to:
* Start with an empty flash even if there was a left over flash file
on disk
* Not overwrite the simulation activity from the first part of the test
in the second part of the test, to allow looking into the
traffic and to allow rerunning the test in check mode, to ensure
there is no radio activity changes when another change is done.
* Set the simulation id to something more unique (it was just
"peripheral" before which is too easy to be repeated in another
test)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Fix the handling of buffers with fragments. What seems to have been
broken is the metadata reference that was not passed to the next frag in
the chain.
Add a test to regression too.
The main user of this is IPSP.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adjust mesh test timing and timeout value for Advertising
Extensions use/fix in Zephyr Controller. The scanning in
Zephyr Controller is delayed when using extended scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
After removing 20ms in advertiser, all subnetwork beacons are sent as high
dense packet of frames with minimal distance between them. That might
cause collisions if beacon interval on devices will coincide.
This commit adds an artificial delay between each subnet advertsing
beacons.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Add callbacks to the stream objects that reflects the
state of the isochronous channel. The connected callback
is called when the isochronous channel is connected, and
similarly the disconnected callback is called when it is
disconnected.
There is a special case for unicast, where if the ACL
disconnects first, then we won't get a ISO disconnect
callback. It should be assumed that the isochronous channel
is no longer valid when the BAP stream enters the idle state,
i.e. when the "released" callback is called.
The purpose of the new callbacks is to provide additional
information to the application. Especially the unicast client
can use this to determine when the stream_start function
can be called again, as there can only ever be 1 outstanding
CIS connection request at a time, but there can be multiple
GATT requests.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Improved the connection reference handling in the BabbleSim test
project in the Bluetooth Host category.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a new BabbleSim test that validates the authorization callback API
from the Bluetooth GATT header.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Bluetooth Mesh Protocol 1.1 is backward compatible with Bluetooth Mesh
Profile 1.0.1, therefore the stack can still be qualified for 1.0.1 if
needed. But explicit support for both versions requires additional
maintenance efforts and doubles the CI time. To make the stack
qualifiable for 1.0.1, the one needs to remove Private Beacons reception
and compile out SHA256 algorithm support.
What is changed:
- Removed `CONFIG_BT_MESH_V1d1` option.
- Removed `transport_legacy.c` which was using 1.0.1 implementation. The
new transport layer has new SaR logic that should still be possible to
qualify for 1.0.1.
- Removed the legacy transport Kconfig options. They are superseded by
the new transport Kconfig options.
- Tester app: `overlay-mesh-v1d1.conf` is merged into
`overlay-mesh.conf`.
- Removed BabbleSim tests for 1.0.1.
- Updated documentation.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Add new workflow steps to the babblesim workflow to run
also the UART tests on the nrf52_bsim.
This commit:
* Enables the single device tests (which we may
move to the normal twister workflow once we fix the
requirement for a fixture)
* Adds as a placeholder the infra for multidevice tests.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The meaning of bit0 in the audio location bitmap will change to
mono audio, so we update the audio location macro and releated
test cases.
Refer to BT SIG ES-22266.
Signed-off-by: Bi Jian <bi_jian@qq.com>
The channel allocation was incorrect when setting up multiple
streams to a single device, in which case we should apply
individual bits to each stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Previously it was not always possible to prepend the header.
It was not possible if the application neglected to reserve the space
for headers. This is bad because it forces a buffer segment allocation
even if the buffer had enough room for the headers. E.g. a payload of 10
bytes in a netbuf of 30 bytes would have been segmented.
We now explicitly reject the buffer if it does not have the headroom.
This allows us to do a nice thing; simplify L2CAP segmentation.
We convert the SDU from the application into a PDU payload, by
prepending the SDU header, i.e. the SDU length in the original buffer.
This PDU payload is ready to be chunked into PDUs without having to keep
track of where in the SDU we are. This has the effect of removing a
bunch of logic in the segmentation machine.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Enable by default the access layer responses random delays.
Commit also adapts all mesh models, samples and
babblesim tests to use random delay functionality correctly.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
If $BASH_SOURCE is the empty string, then those two tests end up with
the same simulation ID. That's not a good time.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Refactor the bap_test_stream struct and rename to audio_test_stream
so that it can be used by CAP as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
For better manageability of tests building, add possibility to build
BabbleSim Bluetooth BIS tests by Twister.
Signed-off-by: Piotr Golyzniak <metody159@gmail.com>
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
The controllers are running the HCI UART async sample.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update the bsim test for the BAP broadcast to use 2 bis.
This tests a larger part of the code, and also verifies
that we can send and receive on 2 BIS without any ISO errors.
This requires the ADV interval to be a multiple of ISO interval
- 10ms, so the advertising interval has been set to 80ms.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
PBP API allows sources to create a Public Broadcast Announcement.
PBP API to parse a Public Broadcast Announcement.
public_broadcast_source application starts extended advertising and
includes a Public Broadcast Announcement. The advertised broadcast
audio stream quality will cycle between high and standard quality.
public_broadcast_sink application scans for broadcast sources and
synchronizes to the first found source which defines a Public Broadcast
Announcement including a High Quality Public Broadcast Audio Stream
configuration.
Add bsim tests for Public Broadcast Profile APIs.
Add shell implementation for Public Broadcast Profile APIs.
Signed-off-by: Daniela Andreea Dumitrache <danielaandreea.dumitrache@nxp.com>
Adds two test-cases to `test_suspend.c`, both checking that gatt
advertisement is stopped when suspending Mesh, and that is started again
when Mesh is resumed.
The first test-case involves suspending and resuming Mesh, and
the second test-case involves suspending Mesh and disabling Bluetooth,
then re-enabling Bluetooth and resuming Mesh.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Renames tx to DUT and rx to Tester to clarify roles in test.
Re-uses the same body for suspend/resume and suspend/disable/resume
for DUT with a parameter to toggle disabling BT.
Re-uses the same Tester config in both existing test-cases as the
previous configs were duplicates.
Updates the dut suspension status in the message handler.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Extracts logic related to waiting for packets from
`test_advertiser.c` and `test_beacon.c` to use in a sync mechanism.
Introduces a sync mechanism in bsim with the functions
`bt_mesh_test_send_over_adv` and `bt_mesh_test_wait_for_packet`
Extracts gatt-related logic from `test_advertiser.c` into a separate
file so it can be re-used.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Emitting network beacons in parallel to proxy functionality
causes collisions. The commit disables network beacons and
allows the test scenario to be more precise.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
On newer GCC version warnings were emitted because of a `memcpy`. The
size parameter was larger than the source's size because it was using
the size of the destination, which was a `bt_uuid_128` when the source
is a `bt_uuid_16`.
Fix the issue by creating a new variable for CCC UUID in both the
central and peripheral code. The variable need to be static because the
discover parameters must remain valid until the start of the discover
attribute callback.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The recommendation to have 20ms is fair for two
consecutive messages over a single bearer. When mesh
sends two messages it can be interpreted as two
bearers working in parallel. No need to keep
an artificial 20ms delay for that. Delay was
removed and all related bsim tests were fixed.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Some beacon tests have strict time conditions and depend
on randomization interval that doesn't guarantee test pass.
This change fixes strict conditions.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Implement the CAP Commander discovery function.
Adds support for it in the shell.
This includes initial babblesim and unit testing as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds test that verifies correct Proxy advertisement behavior for
a device where the Proxy adv requirements changes over time,
both for single and multiple subnets.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Refactors proxy advertising implementation to allow fair sharing of
advertising resources between all subnets.
In the new implementation, each subnet is agnostic to any other subnet
that might have active proxy advertisement work. When proxy
advertisement is triggered, the implementation will first check how
many subnets that has active work. If there are more than one active
subnet, a maximum timeslot will be calculated to ensure that all active
subnets get access to the medium. The implementation will then poll
the next eligible subnet for a proxy advertising request. If the
duration of this request exceeds the maximum timeslot, the duration
for the next advertisement will be set to the maximum value.
If a proxy advertisement for a subnet is interrupted by other
advertising activity, the implementation will now ensure that the
interrupted proxy adv continues from the point where it was
interrupted so that the subnet gets to utilize the entire allocated
timeslot.
This PR also alters the priv_proxy_net_id_multi Bsim test to align
with the refactored proxy advertising scheme.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
The section 3.7.3.1 of the mesh specification recommends to delay
a message publication in certain cases:
- at power-up or upon state change for a time between 20 to 500 ms
- for periodic publications for a time between 20 to 50 ms
This change implements this recommendation by adding the
`CONFIG_BT_MESH_DELAYABLE_PUBLICATION` Kconfig option which enables
the randomization code and by adding the `bt_mesh_model_pub.delayable`
bit field which allows each model decide whether the publications
should be delayed for this model or not.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Why?
- metadata is easier to manage as an array + index
- less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
- decouples ATT PDU size from e.g. SMP w/ LESC
Drawbacks:
- higher memory usage
- kconfig change
The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@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>
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>