Commit Graph

36 Commits

Author SHA1 Message Date
Fabio Baltieri e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Piotr Pryga b9dcc3d4e4 tests: Bluetooth: df: Add missing conn handle assignment
There was missing assignment to a global variable that stores
connection handle. The value was always the same, hence it test
were not failing. The value was passed over from setup state
done for other tests. This change makes sure there is always
correct handle stored in global variable.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga 5922b211c3 tests: Bluetooth: df: Add missing peer supported feature information
There was missing information about supported CTE response feature
by peer device. That caused a test_set_conn_cte_req_enable to fail.
The test expected that peer device supprots CTE response.

The missing information is added in a common code responsible for
connection object preparation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga f0e456dc50 tests: Bluetooth: df: Fix wrong max antenna switch pattern len config
Due to change in Kconfig CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
the Kconfigs in tests were wrong and tests were not building.
The commit sets the max antenna switch pattern length to actual
maximum value.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Piotr Pryga fecc193630 tests: Bluetooth: df: Enable refactored LLCPs for df conn test
There was missing kconfig option that enables refactored LLCPs.
That caused build error in Direction Finding connection_cte_tx_params.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Piotr Pryga ccbe5a56e8 tests: Bluetooth: df: Fix ref to renamed ll_scan_set member
The ll_scan_set::per_sync was renamed to ll_scan_set::periodic.
Direction finding connectionless_cte_rx test didn't build.

The commit fixes the issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Anas Nashif be5fa636d3 tests: bluetooth: nrf52_bsim requires a special setup
This platform requires a special setup and has its own workflow. Do not
list it as integration platform as it violates the rule of having to be
built which is not possible due to missing environment.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-08 09:31:01 +02:00
Katarzyna Giadla 681e3a16c7 tests: Change duplicated names of the test cases
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-03-30 17:42:01 -04:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Piotr Pryga ee4d3acf79 tests: Bluetooth: df: Add CTE REQ expected positive behavior tests
Add expected positive behavior tests for direction fingin in connected
mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Piotr Pryga 405ee0d04c tests: Bluetooth: df: Fix not building connection CTE req tests
The tests for direction finding connected mode were not building
correclty. There were missing Kconfig options that enable missing
functionality to be tested.
Tests were not failing because there were no expected positive
behavior tests added.
Added changes allow to validate all implemented test cases.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Piotr Pryga b6be9fef1c tests: Bluetooth: Fix failing tests related with direction finding
Fixes build issues for tests in related with CTE REQ and
hci commands.
Fixes issues in unit tests for CTE REQ/RSP control proedures.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 09:30:23 -05:00
Piotr Pryga 26a66ee299 tests: Bluetooth: df: Fix not building unit tests
There were changes done to controller code that cause
tests to do not build and fail during execution.
Changes are related with:
- modified code related with extended advertising ADI
  field handling
- added generic double buffer data structure that is
  used in controller
- moved code that was building only when DF is enabled
- added EVENTS_PHYEND that is not available in nrfbsim
  board

The PR addresses those issues.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Piotr Pryga 578902960d Bluetooth: Controller: Add CTE recv and sample in connected mode
In connected mode when Receiving Constant Tone Extensions feature
is enabled, controller shall be able to receive CTE in any
data channel packet.
The commit adds required changes to allow receive of CTE for
all data channel packets in peripheral role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Piotr Pryga c0889b0cc1 tests: Bluetooth: df: remove duplicated code from CTE req tests
There is a common implementation of connection handling code
that may be shared by tests: connection_cte_req and connection_cte-
tx_params.
This commit removes code implemented in common.c and common.h
files. The same code is currently available in ../df/common/
directory.
All calls were updated to use function from common implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-12-22 12:18:17 +01:00
Piotr Pryga d4b0cbee8e tests: Bluetooth: df: Add tests for set conn CTE TX params
Add unit tests for HCI command HCI_LE_Set_Connection_CTE_-
Transmit_Parameters.

Part of a code that was available in df/connection_cte_req/common.c,
related with artificial handling of connection, is moved to
df/common/bt_conn_common.c.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-12-22 12:18:17 +01:00
Piotr Pryga f758daa14b Bluetooth: controller: add missing ADI support in per adv chains
Recently there was added ADI support to periodic advertising.
There was missing implementation of ADI for periodic advertising
chained PDUs and direction finding. Also unit tests for periodic
advertising chains required update to handle ADI field.

The commit provides missing implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-11 18:36:54 +01:00
Yuval Peress 723bb46269 tests: BT: migrate connectionless tx to ztest register
Migrating the test suites to the register functionality allows the
main.c source to focus on the state of the system instead of "which"
test to run. In this example, test_main() now calls:
* ut_bt_setup() and updates the state
* common_create_adv_set(), updates the state, and notifies the
  registered tests that the state has been updated which would trigger
  a run.
* common_delete_adv_set(), updates the state, and again notifies
  the registered tests that the state has been updated.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-10-28 16:57:51 -04:00
Piotr Pryga 982743b765 tests: Bluetooth: df: Add test to verify correctness of relase of PDUs
Add unit tests that will ensure the CTE disable operation does not
cause breaking of LLL operations by too early release of chained PDUs.
The tests verify if numbers of PDUs in free PDUs fifo and free PDUs
memory pool are correct.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-01 14:32:49 -04:00
Carles Cufi e2f85b1124 Bluetooth: tests: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
Bluetooth tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Piotr Pryga 4e43295d22 tests: Bluetooth: df: fix compilation error in per adv chain tests
There was a change in parameters list of function ull_adv_sync_pdu_-
alloc. There was a call in commmon.c file in connectionless_cte_chains
unit tests with use of former parameters list. That caused a compilation
error.

The commit fixes the compilation issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-09-04 10:54:36 -04:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Piotr Pryga 5a4e0dca31 tests: Bluetooth: df: Add tests for enable CTE req and sampling HCI cmd
Add unit tests for HCI commands:
- HCI_LE_Set_Connection_CTE_Receive_Parameters,
- HCI_LE_Connection_CTE_Request_Enable.
Tests validate current implementation of commands handling in HCI/ULL.
Handling of the HCI_LE_Connection_CTE_Request_Enable is not complete,
thus tests don't validate positive behavior the functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-18 20:11:10 -04:00
Piotr Pryga 86c4d9001b tests: Bluetooth: df: Add tests for use of CTE in per adv chains
Bluetooth host may request to send more than one CTE in
connectionless mode. That is relized by periodic advertising
chained PDUs.
To check correctness of implementation of such functionality
new unit tests were added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-07 20:50:03 -04:00
Piotr Pryga bf7bf0bec9 tests: Bluetooth: df: Add connectionless IQ sampling enable unit tests
Add unit tests for connectionless IQ sampling functionality in
controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga c02be507fb tests: Bluetooth: df: Move UT code into connectionless_cte_tx sub dir
Before thic commit the bluetooth/df unit tests subdirectory contained
connectionless CTE TX verification. Due to the implementation of
connectionless CTE RX new set of tests will be provided.
The new functionality requires different: configuration and common
setup code. Because of that, current test code was moved to
connectionless_cte_tx subdirectory.
Code shared by all DF tests is moved to common subdirectory.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 9a14f62742 tests: Bluetooth: df: Fix undefinded symbols error
Remove undefined functions (unsued anymore).
Add missing stub implementation for new DF related radio functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-04-30 11:07:55 +02:00
Piotr Pryga 8e0444cc17 tests: Bluetooth: df: Add missing intergration_platforms
Add intergration_plaforms entry in testcase.yaml.
Thanks to that nrf52_bsim platform will be used instead
of default platforms that do not include nrf52_bsim.
The test will be not dead as it is now (executed only
when tests code has been changed).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-03-17 11:34:26 +01:00
Joakim Andersson 9ca13ca664 Bluetooth: host: Refactor command state set handling to one function
Refactor command state state handling to one function.
When setting state outside of hci_core the cmd macro is not available,
so in order to assign the buf pointer to state the function is needed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-15 16:51:51 +02:00
Joakim Andersson 1367220410 tests: Bluetooth: Fix compilation issue in direction finding test
Fix compilation issue in direction finding tests, undefined references
to radio_df_ant_switching_gpios_cfg and
radio_df_ant_switching_pin_sel_cfg

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-15 10:19:17 +01:00
Piotr Pryga d06b8053b3 tests: Bluetooth: df: add UT for enable CTE for periodic advertising
Adds unit tests for verification of enable/disable CTE for periodic
advertiging in controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga e42334982f tests: Bluetooth: df: Move common code to separate source file
Move common code that may be used by different test units
from main.c to common.c. Main.c should be clean and responsible
for unit tests executioon only. Common functionalities should be
stored in separate file and provided to test source files by
appropriate header file.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga 515f95382e Bluetooth: controller: radio: Add DF configuration to enable CTE TX
Add set of functions that will make possible to configure
radio Direction Finding Extension to transmit CTE for periodic
advertising.

Some of the new Radio API functions are provided as separate
functions changing the same Radio peripheral registers, e.g.
radio_df_mode_set_aoa, radio_df_mode_set_aod. This is done on
purpose and is related with lack of DFE in nrf52_bsim.
To avoid use of conditionally compiled constants to represent
e.g. CTE mode; separate functions were introduced.
Thanks to that DF unit tests are able to compile successfully
without changes in nrf52_bsim platform. Also if DFE is added
to nrf52_bsim there is no need to change the code until it is
desired.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga a8c18ff5f4 tests: Bluetooth: df: Fix build error, missing antenna config in DTS
The DF tests are implemented to be executed with nrf52_bsim platform.
The nrf52_bsim platform does not include Direction Finding Extenstion.
Due to that, radio_df.c compilation failed with error about missing
antenna configuration in DTS.

To solve the problem, I've changed nrf.cmake to include radio_df.c
file when CONFIG_BT_CTLR_DF is defined and CONFIG_SOC_SERIES_BSIM_NRFXX
is not definded.

Thanks to that any other platform is not affected. The file will not
build if there is no appropriate configuration or there are missing
features in a hardwared.

Unit tests have provided stub imlpementation or radio functionality.
If nrf52_bsim has implemented Direction Finding Extension, the
DF unit tests code will stil work and will not require additional
changes. Also content of the file is not affected by contional
compilation entries.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-25 21:46:34 -05:00
Piotr Pryga c705970011 tests: bluetooth: Add unit tests for set connectionless CTE parameters
Add unit tests for Direction Finding set of connectionless TX
CTE parameters. Enable DF in nrf52_bsim board.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2020-12-14 11:23:26 +01:00