Commit graph

66 commits

Author SHA1 Message Date
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
Joakim Andersson 68ce16cf86 Bluetooth: tests: Update EDTT configuration for easier debugging
Update EDTT default configuration to make it easier to debug. The
use of maximum log level to restrict default output caused some
confusion. Instead remove debug options to reduce the default log
output. Enabling debug logs is now similar to other samples and tests.

Remove options commented out, no need to keep them.
Move comment to the matching CONFIG.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:33:16 +02:00
Joakim Andersson e1479a406f Bluetooth: test: Convert EDTT test to using k_timeout_t struct
Convert the EDTT test to use k_timeout_t struct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:46:48 +03:00
Johan Hedberg 31ad7b455b Bluetooth: tests: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Joakim Andersson f2d7b77e96 Bluetooth: host: Deprecate BT_LE_ADV defines in hci.h in favour of gap.h
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Joakim Andersson 405ce842ab Bluetooth: host: Add new argument and return code to bt_create_conn_le
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.

Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Joakim Andersson b5c02d0649 Bluetooth: EDTT: Remove ncmd and opcode from EDTT command response
Encode all types of EDTT command response with similar structure to how
it is generated from command complete when it is generated from the
command status.
This structure will be:
2 byte EDTT command response code
2 byte EDTT length field
1 byte HCI status
N bytes of command output parameters

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson a581443028 Bluetooth: EDTT: Enable disabled tests
Enable tests that was disabled due to test failure. Test have been
updated and are now passing.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson 2c857f9f69 Bluetooth: EDTT: Replace printk with logging
Replace printk with logging, add additional log statements for command
handling.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson 1c551e4835 Bluetooth: EDTT: Remove use of deprecated defines
Remove the use of BT_BUF_USER_DATA_MIN which has been deprecated.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson ba504fbffa Bluetooth: tests: Add privacy configuration for test basic_conn_encrypt
Add privacy configuration when using the split controller for the test
basic_conn_encrypt. The handling with or without controller based
privacy affects the RPA handling in the host due to different
connection complete events being used. This affects the overall pairing
procedure as the addresses are inputs to the pairing functions.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-05 14:33:21 +02:00
Alberto Escolar Piedras de160fd322 tests: bluetooth: EDDT tests: Disable inquiry HCI tests
The tests HCI/CCO/BV-07-C & HCI/GEV/BV-01-C are failing in
EDTT, while the issue is resolved let's disable them
so other tests can be run in CI
For more information see:
https://github.com/zephyrproject-rtos/zephyr/issues/22085
https://github.com/EDTTool/EDTT/pull/2

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-01-31 18:36:40 +01:00
Ulf Magnusson 1b451e0bed bluetooth: kconfig: Do not assign promptless BT_DEBUG
BT_DEBUG is a promptless helper symbol, defined in
subsys/bluetooth/common/Kconfig. It is selected by BT_DEBUG_LOG, which
these configuration files also enable.

Flagged by https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 13:41:29 +01:00
Ulf Magnusson 4d41f03f09 tests: bluetooth: kconfig: Do not assign promptless BT_RPA symbol
Assignments have no effect on promptless symbols. This symbol is enabled
through being select'ed. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 19:00:38 +01:00
Ulf Magnusson d37f09fc2b tests: bluetooth: kconfig: Do not assign promptless BT_CONN symbol
Assignments have no effect on promptless symbols. This symbol is enabled
through being select'ed. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-13 18:59:56 +01:00
Ulf Magnusson 513e36e312 Bluetooth: tests: Remove references to CONFIG_SYS_LOG(_DEFAULT_LEVEL)
Removed in commit 0eb6ffa3e9 ("logging: kconfig: Remove legacy SYS_LOG
symbols").

Detected by an improved CI check that also checks samples and tests.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-10 09:37:47 +01:00
Ulf Magnusson 1f59ad7aea Bluetooth: tests: Fix typo'd CONFIG_ARCH_POSIX in comment
Detected by an improved CI check that also checks samples and tests.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-10 09:37:47 +01:00
Alberto Escolar Piedras 0a21d3c455 tests: bsim_bt: Add EDTT based BT stack tests
Add some scripts to automatically run a set of BT conformance tests.
Each script has an associated file which selects which subset of tests
are run by that script.
The LL scripts are divided in 2 subsets so as to allow parallelizing
a bit the run (the LL tests take the longest).
Except these, all other sets are just divided by category.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-01-08 20:35:17 +01:00
Alberto Escolar Piedras 8be3f983ea tests: bsim_bt: Also compile edtt_ble_test_app in CI
To run the BLE EDTT tests in CI, compile also the BLE
HCI and GATT edtt_ble_test_app variants

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-01-08 20:35:17 +01:00
Alberto Escolar Piedras c256d06aee Bluetooth: tests: Add edtt_ble_test_app
Added application for testing the bluetooth stack
from the EDTTool

Signed-off-by: Henrik Eriksen <heri@oticon.com>
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-01-08 20:35:17 +01:00
Ulf Magnusson 0521eaf578 bsim_bt: run_parallel.sh: Remove semicolons at ends of lines
Not needed in sh.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson 072188d0e8 bsim_bt: run_parallel.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson 9446554969 bt_sim: basic_conn_encrypted_split.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson d779de1f54 bt_sim: basic_conn_encrypted.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson ed4f3cd354 bsim_bt: basic_conn_split.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson c69a501df6 bsim_bt: basic_conn.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Ulf Magnusson d3d79ef4eb bsim_bt: compile.sh: Use lowercase for internal vars
This makes it possible to tell at a glance which variables are internal
to the script and which ones are parameters to it, which is very
helpful.

This convention is pretty common. See e.g. Google's shell style guide at
https://google.github.io/styleguide/shell.xml#Naming_Conventions, and
https://github.com/icy/bash-coding-style#naming-and-styles. It's older
than those though.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-10 14:34:46 -08:00
Joakim Andersson f49bb10ca5 Bluetooth: Samples: Switch to synchronous bt_init before main loop
Switch to using the synchronous bt_init call before starting the main
loop in the peripheral samples. This is to avoid sending notifications
before bluetooth has been properly initialized.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-09 16:11:19 +01:00
Alberto Escolar Piedras 9320c146bd tests: Bluetooth: Bsim tests: expand README a bit
Expand a bit the README file to cover the compile.sh and
run_parallel.sh scripts, in case users would like to use
them locally, to guide them a bit.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-11-21 08:44:26 +01:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Joakim Andersson 3e9888105e Bluetooth: Host: Rename API function to initiate bluetooth security.
Rename bt_conn_security to bt_conn_set_security, this makes the API
naming more consistent.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-27 15:13:25 +02:00
Joakim Andersson 1c48757d94 Bluetooth: Host: Rename security level enum
Rename security level enum, using level and number instead of low,
medium, high and fips.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-27 15:13:25 +02:00
Joakim Andersson c1a754f665 Bluetooth: Host: Print error codes in hex
Error codes are listed in header files and in the core spec as hex
values. Always print them in hex in debug for easier error code
checking.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:18:17 +02:00
Vinayak Kariappa Chettimada f4eb03c538 Bluetooth: controller: Rename BT_LL_SW to BT_LL_SW_LEGACY
Rename the controller Kconfig option BT_LL_SW to
BT_LL_SW_LEGACY in preparation towards switch to new Link
Layer implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-07-22 14:23:42 +02:00
Joakim Andersson 029a66a195 Bluetooth: services: Move Heart rate service
This commit moves the BLE GATT heart rate service from
samples/bluetooth/gatt to subsys/bluetooth/services and adds a Kconfig
entry to enable and configure the service.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-07-11 13:21:14 +03:00
Emanuele Di Santo 30d65809fc Bluetooth: services: battery service enhancements
This commit moves the BLE GATT Battery service
from /samples/bluetooth/gatt to /subsys/bluetooth/services and
adds a Kconfig entry to enable and configure the service;
when enabled, it will register itself automatically.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-07-11 13:21:14 +03:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Vinayak Kariappa Chettimada 40241d81be Bluetooth: controller: Enable additional ULL/LLL CI tests
Add/Enable additional conf files for ULL/LLL CI testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-05-06 14:41:58 +02:00