Commit Graph

105 Commits

Author SHA1 Message Date
Emil Gydesen 42da370df5 Bluetooth: Use ATT FIRST/LAST attribute handle defines where applicable
Change to use the BT_ATT_FIRST_ATTTRIBUTE_HANDLE and
BT_ATT_LAST_ATTTRIBUTE_HANDLE instead of the literal values where
applicable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-04-08 16:35:57 +02:00
Anas Nashif c076d94eec kernel: remove tickless idle
This feature predated the tickless kernel and has been in legacy mode
for a while. We now have no drivers or systems that do not support
tickless, so remove this option and cleanup the code to only use
tickless.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Trond Einar Snekvik 40a2aed778 Bluetooth: Mesh: Friendship BabbleSim tests
Adds Friendship tests to the Bluetooth Mesh BabbleSim test suite. The
friendship tests cover all basic friend establishment and message
sending scenarios, including coverage for previous regressions, such
as #29544, #32033 and #30657.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-19 11:07:31 +02:00
Trond Einar Snekvik bbc9da3d69 Bluetooth: Mesh: Add bsim tests for transport
Adds a test suite for Bluetooth Mesh in bsim_bt tests, including 10
tests for common transport behavior. This test suite includes a readme
and a simple framework for adding more mesh tests in the future.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Alberto Escolar Piedras 59d3fba1a8 bsim_bt: tests: Fix relative paths search in scripts
The way these scripts looked for the current working directory
was not correct or reliable. With this change it should
work properly.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-03-04 11:37:11 +02:00
Wolfgang Puffitsch d5a804e2ac bsim_bt: run_parallel.sh: Fix execution without explicit SEARCH_PATH
Set SEARCH_PATH to "." instead of `pwd` if not set explicitly. This
avoids the construction of paths that contain `pwd` twice in test
scripts such as ll.1.sh.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-03 13:21:35 +01:00
Vinayak Kariappa Chettimada 1e9abde45e tests: Bluetooth: bsim: Fix ISO test to establish periodic sync
Fix the ISO test application to be able to establish
periodic sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-15 08:03:22 -05:00
Vinayak Kariappa Chettimada 483e789697 tests: Bluetooth: bsim: Enable LL/CON/INI/BV-24-C EDTT test
Enable the LL/CON/INI/BV-24-C [Network Privacy - Connection
Establishment using resolving list, initiator, Ignore
Identity Address, with address resolution disabled] EDTT
test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-14 18:17:05 -05:00
Luiz Augusto von Dentz 8df6124deb Bluetooth: ATT: Remove BT_ATT_TX_MAX
ATT channels do support queueing buffer so it no longer need to block
waiting the tx_sem besides the buffer allocation already serves the
same purpose as the application will not be able to have more requests
than there are buffers available.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-02-11 12:59:01 -05:00
Vinayak Kariappa Chettimada abcee4dc2b Bluetooth: controller: Fix BIG Sync Terminate command
Fix BIG Sync Terminate Command to generate Sync Established
event if Sync initiation is in progress.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-26 06:18:23 -05:00
Kumar Gala 3befd7d45f cleanup: rename sanitycheck references to twister
Cleanup references to sanitycheck that should now be twister.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-14 07:50:52 -06:00
Emil Gydesen 06ef2396c0 Bluetooth: controller: Adds initial BIG receiver test
The test currently does nothing, as it depends on the
advertiser part of the test which has not yet been implemented
properly. Also slightly modified how the test is run.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-20 13:36:50 +01:00
Joakim Andersson 068af16e18 tests: bluetooth: Use a valid disconnect reason
Update test_connect1 test case to use a valid disconnect reason.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-12-15 11:20:34 +01:00
Anas Nashif dd931f93a2 power: standarize PM Kconfigs and cleanup
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Emil Gydesen 47e716ba83 Bluetooth: controller: removed node_rx for big create/terminate
Removed the node_rx argument for the BIG create/terminate
functions. The event should not be sent right after the
command, but needs to wait for transmissions of
empty BIS packets or BIG terminate indications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen 4971ad1be6 Bluetooth: controller: Add initial basic ISO broadcast test
Adds a initial ISO broadcast test case that simply
creates, waits and terminates a BIG using the ll API.

The newly created test directory can be expanded to contain
connected ISO (CIS) tests as well in the future.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Vinayak Kariappa Chettimada f5644d4341 tests: Bluetooth: bsim: Periodic Advertising Report generation
Test the LE Periodic Advertising Report generation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-23 17:01:50 +01:00
Vinayak Kariappa Chettimada c4cb838964 tests: Bluetooth: bsim: Set Periodic Advertising Data
Test the implementation of LE Set Periodic Advertising Data
command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-13 09:56:53 +01:00
Vinayak Kariappa Chettimada be090f7b33 Bluetooth: controller: Fix maximum AC PDU payload size calcuation
Fix maximum Advertising Channel PDU payload size calculation
by including the Common Extended Advertising Payload Format
overload alongwith the AD data maximum size supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada b1d087f643 tests: Bluetooth: bsim: Enable 251 byte AD data PDU
Enable the test procedure that requires greater than 31 byte
PDU when AD data and Sync Info structure be present in the
Advertising channel PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Jordan Yates ffab099eb9 Bluetooth: add destroy callback to indication
Adds a `destroy` callback to the `struct bt_gatt_indicate_params` which
is used to signify to the application that the indication operation has
completed and the struct instance can be freed/destroyed.

This is required as the number of indication value callbacks that will
be triggered is not known by the caller when the `conn` parameter is
`NULL`.

Tracking when this callback should be run is mananged by a private
reference counter inside the struct.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Jordan Yates 170f17e0e7 Bluetooth: indication callback signature update
Update the signature of the `bt_gatt_indicate_func_t` callback type by
replacing the attr pointer with a pointer to the
`bt_gatt_indicate_params` struct that was used to start the indication.

This allows the callback to free the `bt_gatt_indicate_params` instance
if it was allocated from storage, while still allowing the
`bt_gatt_attr` value to be accessed through `params->attr`.

Allocating the `bt_gatt_indicate_params` instance from storage is
desirable as multiple indications can be queued, however each instance
must be valid until the callback is run.

Implements API update from #29357

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Vinayak Kariappa Chettimada 53ccde835b tests: Bluetooth: bsim: Extended scanning with duration
Added test to verify Extended Scanning with duration
parameter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-21 12:44:38 +02:00
Vinayak Kariappa Chettimada 6901b6662a tests: Bluetooth: bsim: Fix change to Periodic Advertising API
Fix due to change to Periodic Advertising API, now requiring
callback registration.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada cb67f36029 Bluetooth: controller: Rename to BT_CTLR_SYNC_PERIODIC
Rename Kconfig option BT_CTLR_SCAN_PERIODIC to
BT_CTLR_SYNC_PERIODIC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada 70e5ecaf08 tests: Bluetooth: bsim: Minor print format update
Minor print format update, updated format for Periodic
Advertising Interval.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada fbf6a71cc3 tests: Bluetooth: bsim: Test Periodic Sync Create and Terminate
Added test code to exercise the Periodic Sync Creation,
Terminate and Sync Loss.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada adcb9eff64 tests: Bluetooth: bsim: Added test for Periodic Sync Create Cancel
Added BabbleSim test for Periodic Sync Create Cancel.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada 67dd5a61dc tests: Bluetooth: bsim: Added bsim test to cover Periodic Sync
Added test implementation for test driven development of
Periodic Sync feature support in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada b0cc96ec61 Bluetooth: controller: Add initial ULL Periodic Sync code
Add initial files and code for Periodic Sync feature support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Emil Gydesen 8d7b5ebd7a Bluetooth: Remove _gatt_ infix for Heart Rate Service (HRS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Emil Gydesen b4a8229db6 Bluetooth: Remove _gatt_ infix for Battery Service (BAS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Andrzej Kaczmarek 48646e51d0 tests: Bluetooth: bsim_advx_test: Add some tests for scan response
This adds few tests for handling scan response in ext commands:
- trying to set scan response on non-scannable instance should fail
- it should be possible to create scannable instance, set scan data,
  enable and then disable set

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-09-04 14:30:21 +02:00
Andrzej Kaczmarek 3e7db661d1 tests: Bluetooth: bsim_test_advx: Fix adv_type parameter
The value of adv_type shall be 0x07 for extended advertising, it will
be converted to 0x05 inside ll_adv_params_set after some checks.

This did not cause any issues with tests since input parameters in
already implemented test cases do not test any code that was skipped
by invalid parameter, however obvious one side-effect is that phy_p
would be always set to 1M regardless of input parameter so any test
case using Coded on primary would fail.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-08-31 13:50:13 +02:00
Vinayak Kariappa Chettimada 35f2db810d tests: Bluetooth: bsim_advx_test: Increase sim_length to 60 seconds
Increased sim_length value to 60 seconds so as to meet the
current length of 13.56 seconds and any future test timing
increases in the near future.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:47:36 +02:00
Vinayak Kariappa Chettimada 42ea52c39f tests: Bluetooth: bsim_test: tests periodic adv enable/disable
Update bsim test to test Periodic Advertising Enable and
Disable alongwith Extended Advertising Enable/Disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:47:36 +02:00
Joakim Andersson 5880f3d74f Bluetooth: UUID: Use BT_UUID_16_ENCODE to set UUIDs in adv data
Use BT_UUID_16_ENCODE to set UUIDs in advertising data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-25 16:09:22 +03:00
Dag Bjarvin e93963b719 Bluetooth: controller: Add ll_adv_aux_set_clear function
Add ll_adv_aux_set_clear, add to bsim test

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-08-05 12:52:42 +02:00
Dag Bjarvin a82c34703c tests: Bluetooth: bsim: Add ll_adv_aux_set_remove function
Add tests for ll_adv_aux_set_remove in bsim test app

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-29 16:37:15 +02:00
Vinayak Kariappa Chettimada e0613b9638 tests: Bluetooth: bsim: Added tests for adv set terminate event
Added bsim testing for Advertising Set Terminated event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Dag Bjarvin 12fdddb80d Bluetooth: controller: Add terminate event for external advertising
Add terminate event for duration timeout, max number of events and
connection.

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Vinayak Kariappa Chettimada 36707cdb58 tests: Bluetooth: bsim: Disable test with long AD data
Disable test with long AD data being set, as 251 byte
Advertising PDU is not yet supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-16 14:43:46 +02:00
Joakim Andersson a52c442fc7 Bluetooth: test: Print disconnect reason in hex value
Print the disconnect reason in hex value since the defines are in hex.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Andries Kruithof ed85577a22 Bluetooth: controller: Increase timeout for babblesim
The timeout for testing advertisement extensions in babblesim
was set to 30 seconds. Depending on the hardware used for
testing this may be too low. Increased to 120 seconds

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-06-29 09:27:09 +02:00
Vinayak Kariappa Chettimada 372a2e2fd3 tests: Bluetooth: bsim_test: Include advx testing in CI
Update compile.sh and added test_script, so that
bsim_test_advx bsim_test application is built and run in
CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Carles Cufi b67a31e411 Bluetooth: controller: Remove legacy LL
Remove the legacy Link Layer implementation.

Closes #24187.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-08 15:07:00 +02:00
Luiz Augusto von Dentz f3116842f1 Bluetooth: EDTT: Use bt_buf_tx_get to allocate buffers
Instead of using its own buffer pool use one already available by
HCI_RAW which are accessible with bt_buf_tx_get.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-07 10:31:36 +03:00
Joakim Andersson 45e6921517 Bluetooth: test: Fix redefinition of BT_BUF_ACL_SIZE
Fix BT_BUF_ACL_SIZE in hci_test_app after declaration was moved to
hci_raw.h

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-02 13:08:59 +03:00