Mesh1d1 uses EHP wth SHA256 algorithm as the main one.
This mandates to use 32 bytes static oob if static oob
has been chosen.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Add BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX Kconfig to allow the
omit of EVENT_OVERHEAD_START_US and EVENT_OVERHEAD_END_US in
the time reservation calculations.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in sw switch single timer id use for nRF53x
series SoC.
Regression introduced in commit cfcbe5d68e ("Bluetooth:
Controller: Remove redudant header file includes").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The test fixture used an invalid struct for the param
due to a renaming of the struct in another commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of calling ase_release for each ASE in the ACL
disconnected callback, we now call the state_transition_work_handler
directly. This is to ensure that when the disconnected callback
returns, the bt_conn object has been properly unref'ed in
a timely manner.
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>
Fix ticker implementation to prefer to keep ticker node
started in case of race condition to start and stop.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Included kconfigs to set the ISO-AL logging level and control debug
logging verbosity in ISO-AL unit tests.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Updated unit tests to match changes in ISO-AL that disregard the length
of a received PDU with errors.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Changes:
-- Changed RX tests and one TX test to cover endianness of the framed
segment header fields
-- Updated RX debug PDU print to include framed segment details
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Changes:
-- Included a test to check TX in concesecutive events irrespective of
the input target event
-- Updated expected output of current tests for change in framed RX
error handling which waiting for the start of an event
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
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>
After recent refactors some PACS characteristics have to be enabled
with CONFIG_ variables.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
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>
This fixes implicit declaration of function
‘bt_bap_unicast_server_disable’ compilation warning.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This fixes linker warning caused by invalid bonding of linker scripts
provided by multiple "-T" options.
mock-sections.ld contains output sections did you forget -T
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
rp_enc_state_wait_ltk_reply() is executed in thread context, so
it is not allowed to move the encryption state machine forward.
Defer LTK reply handling to next prepare event by introducing a continue
state.
Update the unit test to reflect this, and remove the TODO that actually
said there was an issue in the first place.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Adds a target RPA known unknown cache; it fulfills a similar function
to the existing peer RPA cache, used for scanning of directed
advertisements
Signed-off-by: Troels Nilsson <trnn@demant.com>
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 Kconfig options to make the various PACS characteristics that are
optionally notifiable selectable as notifiable. Selecting a
characteristic as notifiable will make it so for all pacs instance on
the device.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
- Fix masking for no coded phy
- Allow ISO_Interval < SDU_Interval for framed mode
- Change BT_HCI_ERR_INSUFFICIENT_RESOURCES to
BT_HCI_ERR_CONN_LIMIT_EXCEEDED.
- Prevent starting same CIS twice
- Cancel an initiated CIS creation procedure if terminated before
sending CIS_IND.
- Implement canceling of local CC procedure. Respond to CIS_RSP with
REJECT, if canceled after CIS_REQ was sent.
- Introduce state CIG_STATE_INITIATING for central, to keep track of
initiating CIS connection, in transition between CONFIGURABLE and
ACTIVE.
Fixes EBQ test /HCI/CIS/BC-03-C.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This extends the list of build variants with native_posix variant to
build the tester application by CI.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This moves the board DT overlays and configurations to /board
directory so that it can be automatically applied in compilation
pipeline.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add test to verify that
1) A peripheral role cannot initiate an encryption pause
2) A peripheral role rejects a LL_PAUSE_ENC_REQ while a CIS is
established
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
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>
This updates the testcase.yaml to include new configurations for
LeAudio, Mesh and native builds.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The streams can be deallocated once bt_bap_stream_ops.released callback
is called. Otherwise it may cause memory violation in the stack.
Fixes: ASCS/SR/ACP/BV-31-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds test case testing whether ASE in Enabling state will accept
releated CIS Request if previous CIS establishment procedure failed.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds test cases testing correctness of autonomous ASE
state transitions triggered by CIS link loss.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds a possibility to get the ISO channel pointer from
test_preamble_state_disabling function that can be further used in
tests.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This extends mock_bt_iso_disconnected function parameters with error
code that can provide the HCI error code that is the reason of CIS
disconnection.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Extend Codec capabilities of the server.
At Codec Config operation initiated autonomously by server, all ASEs
with lower IDs than the requested one have to be initated first due
to API limitation.
In some BAP/USR (server role) test cases the PTS sends the MMI 202
to configure the Sink ASE to streaming state, in some others it does not.
For now, let's autonomously send Receiver Start Ready at ASE Enabled.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
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>
The number of subgroups the scan delegator supports should
match the number of subgroups the broadcast sink supports.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify audio_send_timeout to use bt_bap_stream_get_tx_sync
instead of bt_iso_chan_get_tx_sync to avoid using an internal
function to get the ISO channel from the BAP stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
- Initialisation of Coordinated Set Identification Service.
- Set and clear member lock.
- Get member RSI.
Signed-off-by: Henrik Eriksen <heri@demant.com>
Allow to assing end points to CISes before creating a CIG. Previously
the end points were assinged top-down, so the configuration 7(i) and
other similar were not covered.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
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 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>
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>
Recently there have been a few name changes in the API that caused
build errors of the tester application when LE Audio overlays applied.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
When a stream leaves the streaming state the `stopped` callback
will now be called, similar to how the `started` callback works.
This ensures that `stopped` is always called and not just when
the CIS disconnects.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The enum used for connection types gets named bt_conn_type to guard
against accidental usage of generic integers with relation to it.
The added default case in several switch statements avoids warnings
against unhandled enum values.
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
This refactors the code to use exact copy of bt_gatt_attr_read instead
of mock, as the implementation might call the function with stack
allocated value. Using mock would require deep copy of the value for
further verification. As the buffer where the value is about to placed
is one of the attr->read() parameters, the test may call the read()
callback with stack allocated buffer of defined size and read the value
from the buffer.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
This adds tests for receiving ISO Data PDU.
* test_recv_in_streaming_state - test whether received ISO Data PDU is
sent to upper layers.
* test_recv_in_enabling_state - test whether received ISO Data PDu is
dropped because upper layer is not ready to receive the data yet.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
PTS l2cap tests need BT_BUF_ACL_RX_SIZE to be 100.
Signed-off-by: Lang Xie <Lang.Xie@nordicsemi.no>
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Some values have been reduced and some have been increased to
better follow the audio configurations in BAP and support
more incoming data.
Also removes HRS as that is not used by LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_has_register_param was renamed to bt_has_features_param
recently. Fixes build errors.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
The host app should increment the sequence number within SDU interval
whether it has any data to send data to the controller or not.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Following the previous commit that introduce the settings API for the
Bluetooth subsystem, some unit tests needed to be updated to use it.
Signed-off-by: Théo Battrel <theo.battrel@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>
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>
ATT attributes can be up to 512 bytes long, so the comparisong needed
fixing.
See spec v5.4, Vol 3, Part F, 3.2.9.
Fixes#57930.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Introduce a Kconfig BT_CTLR_ISOAL_SN_STRICT to relax the Tx
ISO Data SDUs being dropped due to strict check of sequence
numbers in ISOAL, i.e. dropped when ISO Data SDUs are
delayed from upper layer with respect to the current
payload number in the ISO radio events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@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>
-- Updated test cases to include missing / lost SDUs.
-- Included tests for receiving only framed padding PDUs.
-- Removed tests linked to sink and source configuration params as these
were unused and removed.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Testing:
-- Receiving only padding PDUs for an SDU
-- Receiving leading padding PDUs (not an expected use case)
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
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 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>
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Continue test execution even if assumption failed. This won't break the
test execution prematurely and allow to perform a cleanup.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This change makes VCS Volume Flag characteristic Notify property
optional and selectable through Kconfig.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
This is required by GATT/SR/GAW/BV-14-C where PTS does a lot of small
writes to characteristic of 512 bytes.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
When possible re-use the already allocated RX node for notifications.
Store (retain) RX node and Link element on RX if NTF could occur.
Pass link element to LLCP (ull_cp_rx()) together with RX node.
New RX node type RETAIN introduced to signal retention
When no RX node is available allocate one and hold off TX on procedures
until such time that a node is available for NTF.
In case waiting for NTF buffer avail is needed, allocate and store TX
node to use for TX once NTF becomes available.
CIS Established (incl. timeout handling) is now handled entirely as a
specific event driven by ull_conn_iso - ie removal of procedure check
of cis->established and cis->expire, as this is doubling mechanism
in the conn_iso context.
Unit test and helpers updated to handle new node type.
Function ull_cp_release_ntf() was used only in unit test, so moved to
helper context.
Updating release_ntf to handle the fact that with piggy-backing in test
context the node used for NTF can be from two different memory pools
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
There is no need to store the RPA in bt_addr_le_t structure, as the
bt_addr_le_t.type is unused anyway. Both bt_rpa_create and
bt_id_set_adv_random_addr take bt_addr_t as parameter.
Saves 1 byte of address type.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add check to see if RPA is already generated for adv sets
with same id. If generated use the same address for all adv sets
with same id else create new RPA.
Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Check RPL when rescheduling happens during the reset operation
started by bt_mesh_rpl_reset.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The function bt_codec_cfg_get_chan_allocation_val takes a pointer
to an enum, rather than an uint32_t, but was wrongly defined in
the header files and incorrectly used a few places.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Include ticker expire remainder value when calculating the
cis_offset to acheive fine timing in scheduling the CIG
radio events relative to its associated ACL radio events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Start/pause encryption should not be initiated on ACL with CIS
established (BT Core Spec 5.4, Vol 6, Part B, Sect. 5.1.3)
Adding test for the added procedure peek function
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Calling bt_bap_stream_start moves the ASE to streaming state.
If the function is not called the Sink ASE stays in enabling state.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
In the helper-module we do a memcpy of a structure but the size
is possibly incorrect.
This PR ensures that the correct sizes are used.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
This adds 2 new test cases that test whether arrayed parameters are
handled properly.
This improves the existing test_codec_configure_invalid_ase_id_unavailable
test case by handling request conatining 2 ASE_ID's where the 1st is
invalid.
This reproduces the issue fixed in
419772db94238debe114dfac337f5b238a15436e.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add configurations where CONFIG_BT_AUDIO_TX and CONFIG_BT_AUDIO_RX
are disabled.
Fixes issues found in the BT shell implemented caused by these
configurations.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This adds tests that validate the implementation handles invalid length
Control Point operations.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Update BTP_ASCS_CONFIGURE_CODEC to send codec specific configuration
in LTV format.
Update parameters of BTP_ASCS_CONFIGURE_QOS to match the BT spec
defined lengths.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Use the minimum supported cis_offset_min considering that
ACL radio event does not overlap with CIG event. Use the
calculated maximum of local and remote cis_offset_min in the
Response PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
MISRA Rule 5.7 requires uniqueness of tag identifiers. Shell is
frequently problematic because many code uses `const struct shell
*shell`. This causes CI noise every time one of these shell files is
edited, so let's update all of them with `const struct shell *sh`
instead.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
-- Unit test to check that the correct payload number is selected based
on the SDU packet number and the time stamp when fragmenting SDUs
into PDUs.
-- Ran clang-format on isoal_test_tx and isoal_test_rx
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Many areas of Zephyr divide and round up without using the DIV_ROUND_UP
macro. Make use of it, so that we make use of a tested system macro and
at the same time we make code more readable.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Since behavior of CONFIG_LOG_DEFAULT_LEVEL was changed, if set to debug
level, causes stack overflow on nrf52 board.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
This adds test_mocks_reset function to be called after test case
preamble. The motivation is to reset the function call state that might
be affected by steps perfromed in the preamble stage, which is not the
code under test.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The iso_server shall be not set to NULL in mock_bt_iso_cleanup(), as
it's UUT responsibility to call bt_iso_server_unregister(). Cleaning
the iso_server in mock_bt_iso_cleanup() might hide bug in the code.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Remove qemu_cortex_m3 from various bluetooth tests and samples since
they enable NVS which requires CONFIG_FLASH_PAGE_LAYOUT which is
not supported on qemu_cortex_m3 since there is no flash driver.
We get build failures with the arm-clang compiler because nvs.c
is referencing z_impl_flash_get_page_info_by_offs which does not
exist.
Switch to qemu_x86 as the integration_platforms if it was
qemu_cortex_m3 before.
Removed the bluetooth.mesh.mesh_shell.reduced_legacy as this was
added specifically for building on qemu_cortex_m3.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Support for tests that use ASCS operations Codec Config, Config QOS,
Enable, Disable, Update Metadata, Release.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
This adds new hidden compilation flags that indicate whether the
implementation is configured to be able to receive/transmit audio data.
The flags are profile agnostic to loosen dependencies between
modules/services.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
There is no requirement that HRS shall be on a peripheral device
as far as I can tell, and as such the device with HRS may not
be a GAP Broadcaster. Guards the advertising with
CONFIG_BT_BROADCASTER.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Default BT_BUF_ACL_RX_SIZE value varies based on selected host options.
Many buffers size (L2CAP COC MPS in particular) depends on that value
and those may affect qualification test cases steps.
To make core tests more predictable just use fixed values big enough to
comply with all configurations requirements.
This was affecting L2CAP/COS/ECFC/BV-04-C.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit adds new API functions for AICS
Setting automatic/manual only gain modes
Setting mute disabled
Use new functions in btp.vcp
Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
Some peripheral tests are failing if CONFIG_BT_EXT_ADV=n.
That was previously implicitly enabled by MESH but it has
dedicated overlay.
Affected tests:
GAP/BROB/BCST/BV-03-C
GAP/CONN/UCON/BV-06-C
GAP/PRIV/CONN/BV-10-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This adds ASE_ID getter function to be used in the tests. The function
performs read operation on ASE charateristic. The characteristic value
is ensured to be ASE Idle state characterisitic value, which carries
information about ASE_ID value.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This refactors the function used to get the ASE for the tests.
Reworked function allows to get several ASE's for the test with a single
function call.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This cleans up the code by moving the ASE State Machine transition
test cases to separate source file.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Key size validation was missing on getting local database which
resulted in selecting invalid characteristic by PTS for key size
validation tests.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This adds basic functionality that mocks the k_work API. The ASCS uses
delayed work to defer the CIS disconnection.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds ISO mock with very basic functionality that is needed to mock
the `bt_iso_` functions used by ASCS.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This moves the ISO server registration to bt_ascs_init.
When the ASCS gets cleaned up (the callbacks are unregistered), the ISO
server gets unregistered.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This fixes invalid Unsupported Opcode Response_Code that
happened to be sent in ASE Control Point notification
as the response to operation initiated with Mandatory opcode
to support.
When the Unicast Server callbacks are not registered, every
operation that is initiated by client will fail with
Unspecified Error instead.
Fixes: #56139
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds cleanup of ASCS that is called when upper layer unregisters
it's callbacks. Without callbacks registered, the service is unusable.
The ASE's that were in non-idle state stay in this state, because the
implementation returns an error on every operation that is performed by
the client. The cleanup added moves all the ASE's to idle state.
Fixes: #56111
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This tests functions accessible from blob_io_flash via `bt_mesh_blob_io`
object. Whole partition of slot1 is filled with test data using
flash_map API and then read using blob_io_flash, by reading it as blocks
and chunks. `chunk_wr` is tested my writing sample data of size of slot1
partition and checked if each chunk is written correctly, and if whole
partition is filled with correct data at the end. Both of these test
use `bt_mesh_blob_io_flash_init` and `io_open` to prepare stream and
call `block_start` at every new block to check if flash is prepared
correctly.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
This commit moves app from /tests/bluetooth/mesh to
tests/bluetooth/mesh/basic. This allows to reuse /tests/bluetooth/mesh
directory as location for more tests.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
This command allows for more predictable GATT database changed tests
and allows to reduce custom test configurations from autopts.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Initially I was hoping we can avoid dedicated overlays and have all
config options enabled but it turned out that built-in services
may affect other tests (especially core related like GAP and GATT).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Previously tests were passing only because initial value in
database and PTS value used for testing had same length.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This fixes merge conflict issue by adding missing function
parameters that were introduced in
57784df5f0.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds initial ASCS unit tests.
Failing test cases have been conditionally skipped with Zephyr issue
number.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Unit test project for bt_dh_key_gen().
This is part of subsys/bluetooth/host/ecc.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_pub_key_get().
This is part of subsys/bluetooth/host/ecc.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_pub_key_gen().
This is part of subsys/bluetooth/host/ecc.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_pub_key_is_debug().
This is part of subsys/bluetooth/host/ecc.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Fix#55957. The `bt_buf_get_evt` test was using `net_buf` structures
without allocating it properly.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Some systems can support only legacy OOB pairing while others only
LE SC OOB pairing.
The existent API function "bt_set_oob_data_flag" was removed.
Two new API functions were added:
* "bt_le_oob_set_legacy_flag" to signal that legacy OOB pairing is used
* "bt_le_oob_set_sc_flag" to signal that LE SC OOB pairing is used
The code will now advertise the presence of OOB flag depending
on the type of pairing method(SC vs legacy)
Signed-off-by: Sebastian Panceac <sebastian.panceac@ext.grandcentrix.net>
Bsim won't be limited anymore to BT tests.
In preparation for adding more tests in network areas
swap the tests/bluetooth/bsim with tests/bsim/bluetooth
There is no other changes in this commit beyond that.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Updated the script that compiles all different permutations so
that it starts with the correct configuration file
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
This commit removes the legacy LLCP code including the
Kconfig option
It also updates the babblesim tests, and removes the
tests for the legacy controller
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Tests behaviour of API (addition and deletion of slots, setting valid
state, iteration through slot list). Tests if slots are correctly
saved, recovered and deleted from persistent storage.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Fixes regression introduced in 26cf0b6850
"bluetooth: tester: Add support for missing BTP L2CAP listen param".
Success status was missing resulting in BTP to fail for tests that
require success on connection.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Modify the tests to only have a single set of connection
callbacks, where all the tests can use the same default_conn
and flag_connected.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
To ensure no indeterminism, synchronize devices before they
boot, and therefore before the test main function is executed.
Note that at this point, there is no actual indeterminism
to correct.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This API was creating more problems than solving. We should not use back
channel in bsim tests unless there is no other way to communicate
between devices. To synchronize devices we should use k_sleep.
This addresses
https://github.com/zephyrproject-rtos/zephyr/issues/55821
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This adds unit tests for bt_data_parse.
The sample data concept used in test is based on AD Structures of
Advertising, Periodic Advertising, and Scan Response presented in
Core specification.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Adds waiting for the control point operation callbacks in the
unicast client BSIM test, ensuring that the callbacks work, but also
testing that the server is correctly sending them.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
stuct btp_mesh_cfg_model_sub_add_cmd was used instead of struct
btp_mesh_cfg_model_sub_ovw_cmd for parsing command.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_ENCRYPTION is used to indicate
encryption is required (but not authentication).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
To apply when the hci_rpmsg controller with overlay
nrf5340_cpunet_iso-bt_ll_sw_split.conf is used on the netcore.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
(unsigned - unsigned) is always >= 0, so I believe the right compare
string is (unsigned > unsigned), otherwise we would check for (is
equal).
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Unit test project for bt_encrypt_be().
This is part of subsys/bluetooth/host/crypto.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
Unit test project for bt_encrypt_le().
This is part of subsys/bluetooth/host/crypto.c unit testing.
Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
The friendship tests are dependent on the attenuation
level as they take (much) longer with higher channel
attenuation.
As BabbleSim's "magic" modem model (default one used in these
tests) has been updated to provide a somehow accurate
RSSI measurement, one of these tests fails
tests/bluetooth/bsim/mesh/tests_scripts/friendship/msg_mesh_low_lat.sh
fails with the default channel attenuation of 60dBs.
Reduce the channel attenuation to 35dBs to approach the
previous RSSI values this tests were seeing on the DUTs with the
default modem.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The native_posix board can also be used for audio, and
thus should have LC3 support similar to the nrf5340.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
After 1de363d9d5, compile.sh stopped failing on build
failures as failing jobs in the background would neither stop
the script nor have their status propagated.
Fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
These tests are creating and deleting temporary files.
But they deleted them with a wildcard that
matched each other's temporary files causing failures
when the tests run in parallel.
Avoid it by only deleting the files for each test.
As a freeby: Add the option to pass arbitrary commands to Phy from the
calling script, as with most other tests
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This make is easier to verify if proper use of BTP is maintained.
tester_rsp and tester_rsp_full will be removed eventually when
BTP is fully async.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
We always have 0 index (and occasional NONE index) so there is no
point in validating those in each handler.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
bt_addr_le_t matches BTP convention for addresses and it makes it
so much better to handle those directly from command structures.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This changes the way of BTP commmand handlers are called. Instead of
calling functions to handle service we now provide API for registering
callbacks per command. This allows to keep common checks (size etc)
in single place for (most) commands. Also provide common buffer for
reponses forcing callbacks to handle replay in common way.
In this commit only Core and GAP services are converted. This leaves
rest of services unfuntional (but code stil compiles correctly).
Other services are converted in following commits.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
There are a couple of places where read access to uninitialized memory
happens in new mesh-1.1 tests. Valgrind highlights them.
PR fixes them.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Added a new header file bap_lc3_preset.h which contains
the definitions of the LC3 (pre)sets defined by the
BAP spec.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>