Commit graph

624 commits

Author SHA1 Message Date
Carles Cufi 6f8dd90a83 Bluetooth: tester: Ensure the app is bondable by default
Ensure the bondable Kconfig option is set unconditionally.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi 2b48a8f37b Bluetooth: tester: Fix packet field name
Correct the name of the boolean include in the set bondable
command so it reflects the spec.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi 5cbc3e0c6c Bluetooth: tester: Tweak nRF52840 config
Disable stack measurements by default, since they pollute the log
output.
Ensure that the logging thread has enough stack.
Ensure that the UART that connects to the BTP client is
interrupt-driven.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi 613e5f541f Bluetooth: tester: Update GATT cmds/evts to the latest BTP spec
Fill in all the missing GATT commands and events in the latest BTP
specification.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-22 19:15:04 +02:00
Carles Cufi 2be22c0473 Bluetooth: tester: Update GAP cmds/evts to the latest BTP spec
Fill in all the missing commands and events in the latest BTP
specification.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 18:17:59 +02:00
Carles Cufi cee1954ac3 Bluetooth: tester: Add abundant logging in GAP
Log all error conditions in GAP for easier debugging.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 13:42:07 +02:00
Carles Cufi 7f5ae21a6d Bluetooth: tester: Add logging in core handlers
Add warnings when something goes unhandled.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 13:42:07 +02:00
Carles Cufi b01cd4c7bb Bluetooth: tests: tester: Add an init log message
Add a log message to let people running the test know that the tester
booted up correctly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02:00
Carles Cufi 5af621282e tests: bluetooth: tester: Add a config for the 52840 DK
Add a configuration file for the nRF52840 DK so that it uses RTT for
debugging and enables more protection measures.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02:00
Carles Cufi 6de5c4b7b3 tests: bluetooth: tester: Clean up configuration
- Use the built-in mechanism for configuration overlays
  (having a boards/ folder with <board>.conf fragments)
- Clean up variables that were giving warnings

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02: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
Luiz Augusto von Dentz 6a66879050 Bluetooth: shell: Advertise when registering HRS service
This makes simulate command advertise with proper UUID so the likes of
central_hr can connect to it when simulating:

hrs simulate on
Registering HRS Service
Connected: 00:aa:01:01:00:24 (public)
Start HRS simulation

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-02-06 08:43:09 +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
Carles Cufi c71f5eddec tests: bluetooth: mesh: Convert to new GPIO API
Use the new API and replace the enable/disable callback calls with pin
interrupt configuration instead.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Joakim Andersson ab2902ec69 Bluetooth: tests: Update hci_prop_evt for LE Set Random Address command
Accept LE Set Random Address command during HCI init.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-03 12:44:39 +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 cf89ba33ea global: Fix up leading/trailing blank lines in files
To make the updated test in
https://github.com/zephyrproject-rtos/ci-tools/pull/121 clean, though it
only checks modified files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-27 17:41:55 -06:00
Peter Bigot 6a964663b1 treewide: use full path to console/uart_pipe.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Asger Munk Nielsen 86116fe7de Bluetooth: Controller: Add unit test of SW privacy feature
Unit test of Sw deferred privacy data structure and related functions.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2020-01-15 12:52:25 +01:00
Ulf Magnusson 2f2a04d167 tests: bluetooth: kconfig: Do not assign promptless BT_MESH_PROV
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

BT_MESH_PROV is already selected by BT_MESH_PB_ADV and BT_MESH_PB_GATT,
which these configuration files enable.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 16:49:25 -05: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
Johan Hedberg 4e135d76a3 Bluetooth: shell: Add printing of remote version information
Add printing of the remote version information whenever the new
CONFIG_BT_REMOTE_VERSION option is enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-23 14:47:31 +02:00
Johan Hedberg 0e91493ab4 Bluetooth: L2CAP: Make channel ops const
Make the channel ops struct const since there really isn't anything
there that needs to change at runtime. The only exception is the L2CAP
shell which was playing with the recv callback, however that can be
fixed by introducing a simple bool variable.

With tests/bluetooth/shell this reduces RAM consumption by 112 bytes
while adding only 16 bytes to flash consumption.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-19 11:28:24 +02:00
Asger Munk Nielsen f6f33dfb8f Bluetooth: controller: SW deferred privacy build test
Build test of feature

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-12-13 15:35:25 +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
Johan Hedberg fcbfb53525 tests: mesh: Fix build for bbc_microbit
A recent patch changed the default ISR stack size for bbc_microbit
which causes this app to consume more RAM than is available. Fix this
by specifying an explicit stack size.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-10 12:56:37 -05:00
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Joakim Andersson b30b480c7c Bluetooth: UUID: Expose bt_uuid_to_str to application
Expose the bt_uuid_to_str function as an API to the application.
This aligns this function with the bt_addr_to_str function call. This
allows the application to use this function without having to enable
the BT_DEBUG option.

Move the in-place bt_uuid_str to internal logging, this is mainly done
due to the limitation in the log_strdup that shouldn't be exposed to the
application.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-09 17:15:05 +02: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
Jacob Siverskog 7096fa512f Bluetooth: GATT: Remove all subscriptions for connection when unpairing
Make sure all subscriptions are removed when a connection is unpaired.

Fixes #21131

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-12-04 19:14:28 +01:00
Johan Hedberg 39291fbbbe Bluetooth: Remove usage of BT_BUF_USER_DATA_MIN
This define is not of use anymore since there's a global net_buf user
data Kconfig variable and its definition already guarantees a
sufficient minimum for Bluetooth.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-11-28 13:35:11 +02: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
Maksim Masalski e9d7565d66 tests: remove duplicate names for the bluetooth tests
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-10-24 06:29:17 -04:00
Johan Hedberg 5537181e1a Bluetooth: Fix missing includes for hci.h
With the changes in PR #19836 applications now need to explicitly
include hci.h to use defines from it. Fix two sample/tests apps which
were missing this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-10-17 19:05:33 +03:00
Kamil Piszczek 92d9e30527 tests: migrating to NVS backend with settings
Bluetooth tests now use the NVS backend for Settings.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-10-11 14:55:24 +02: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
Krzysztof Chruscinski 4b59690330 tests: bluetooth: mesh: Fix RAM shortage failure for bbc_microbit
Test for bbc_microbit was failing due to RAM usage. Reduced main
stack size and turned off temperature algorithm to fit.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Carles Cufi f8da57a93e tests: bluetooth: shell: Revert back to default logging settings
Disable the CONFIG_TEST_LOGGING_DEFAULTS Kconfig option which forces
immedate logging, since that is not compatible with Bluetooth and its
tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-10-01 19:11:16 +02:00
Anas Nashif 2d4837061a tests: fix identifiers
Fix identifier and rename plain 'test' to something more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Anas Nashif 96ad532b58 tests: move Bluetooth at tests under tests/bluetooth
this is not a unit test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-27 15:23:26 -04:00
Mariusz Skamra 9828b0fae8 Bluetooth: tester: Adapt to BTP Get Attribute Value API change
Adapt the gatt_get_attribute_value_cmd to recent changes in API.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-09-25 17:36:05 +02:00
Luiz Augusto von Dentz 03b9ce487c Bluetooth: GATT: Add support to setting permission on CCCD
This adds support to set different permissions to CCCD so security can
be checked when enabling notification which conforms to:

BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G page 2360:

  '3.3.3.3 Client Characteristic Configuration

   Authentication and authorization may be required by the server to
   write the configuration descriptor.'

In addition to that also ensure that notification are not re-enabled
until the proper security level is reached to conform to the following
statement:

  '10.3.1.1 Handling of GATT indications and notifications

   A client “requests” a server to send indications and notifications
   by appropriately configuring the server via a Client Characteristic
   Configuration Descriptor. Since the configuration is persistent
   across a disconnection and reconnection, security requirements must
   be checked against the configuration upon a reconnection before
   sending indications or notifications. When a server reconnects to a
   client to send an indication or notification for which security is
   required, the server shall initiate or request encryption with the
   client prior to sending an indication or notification. If the client
   does not have an LTK indicating that the client has lost the bond,
   enabling encryption will fail.'

Fixes #17983

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-09-19 21:12:39 +03:00
Andrew Boie df434592d6 tests: bluetooth: mesh: adjust microbit config
Disable logging defaults for this test, enabling logging
causes this test to not fit in RAM.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-12 05:17:39 -04:00
Luiz Augusto von Dentz 51ffabfa56 Bluetooth: UUID: Add test for bt_uuid_create
This adds test for bt_uuid_create APIs using a byte array in LE/BE
format as it is expected and then proceed to compare with matching and
unmatching UUID declared in host byte order.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-09-03 16:41:00 +02: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
Luiz Augusto von Dentz 5f3595e47c Bluetooth: GATT: Fix using variable size storage for CCC
This removes the necessity of registering the storage for CCC and make
it part of the declaration itself.

Fixes #18547

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-08-22 15:14:39 +03:00
Luiz Augusto von Dentz 6c8eebe046 Bluetooth: GATT: Fix dereference after NULL check
This fixes the coverity problem which which in fact is a non-issue as
the code would assert before reaching that line which makes the NULL
pointer check useless so this removes it.

Fixes #18431

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-08-19 13:09:26 +02:00
Vinayak Kariappa Chettimada e8b776a9b0 Bluetooth: mesh_shell: Disable controller filter
Disable controller filtering feature not used on mesh stack.
This reduces some RAM usage.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-08-11 16:42:52 +02:00
Joakim Andersson 513244afe2 Bluetooth: Shell: Add whitelist commands to shell
Add shell commands to add and remove devices from the shell.
Add commands and options to use whitelist for advertising, scanning,
and creating connections.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-09 16:26:10 +02:00
Mariusz Skamra 5a7a520ea1 Bluetooth: GATT: Add BTP Discover All Primary Services command handler
This will handle BTP Discover All Primary Services command.

Related TC: GATT/CL/GAD/BV-01-C
Fixes: #17861
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-08-07 18:07:45 +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
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Carles Cufi 34ffda3d23 tests: mesh_shell: Optimize prj.conf to fit in nrf51
Disable various LL features to be able to fit in RAM for the
nrf51_pca10028.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-07-29 19:08:05 +02:00
Wolfgang Puffitsch f62fe1551a tests: Bluetooth: Add test case for settings in the controller.
Test case to set and change Company Id and Subversion Number.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-07-23 10:58:03 +02:00
Vinayak Kariappa Chettimada fb8166ad26 Bluetooth: mesh: Use legacy LL for microbit build
Use legacy LL until RAM utilization is optimized in the new
LL.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-07-22 14:23:42 +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
Mariusz Skamra 8b27af58eb Bluetooth: tester: Change RPA timeout
This changes RPA timeout so that the address is changed every 60
seconds. This change is needed to speed up privacy related test cases.
Currently, the new RPA was initiated on request that was a bit hackish
and could be done via BT_RPA_TIMEOUT Kconfig option.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-07-19 16:28:13 +03:00
Mariusz Skamra 1074efd3cd Bluetooth: tester: Update to recent conn param related changes in BTP
This updates tester application to recent changes in BTP related
to Connection Parameters Update.
Connected event has been extended with connection parameters.
Connection Parameters Update command and event have beend added to
initiate and track current connection parameters.
Needed to automate qualification test GAP/CONN/CPUP/BV-06-C

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-07-19 11:24:11 +02:00
Mariusz Skamra d4f1a5aba6 Bluetooth: tester: Enable GAP writable device name
This enables support for GAP writable device name in tester application
for testing purposes.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-07-18 14:36:30 +02:00
Mariusz Skamra 35dcab988e Bluetooth: tester: Enable Mesh Friend support
Enable Mesh Friend support in tester application.

Fixes: #17600
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2019-07-18 14:35:40 +02:00
Wolfgang Puffitsch 845064bb31 Bluetooth: controller: hci: Add user hooks.
Add hooks for processing of HCI user events on the controller side.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-07-17 13:53:13 +02:00
Nicolas Pitre 6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Anas Nashif ba31f4fc35 tests: bluetooth: shell: remove whitelisting on arduino_101
Not a primary bluetooth testing platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07: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
Nicolas Pitre 2dc6eea143 test/bluetooth: sizeof() is not strlen()
sizeof(value) returns the size of the pointer, not the pointed string.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
tests/bluetooth/gatt/src/main.c
2019-07-04 10:25:41 +03:00
Andy Ross f288d1e4a7 tests: samples: Apps shouldn't set tick rate
Tick rate is becoming a platform tunable in the tickless world.  Some
apps were setting it due to requirements of drivers or subsystems (or
sometimes for reasons that don't make much sense), but the dependency
goes the other way around now: board/soc/arch level code is
responsible for setting tick rates that work with their devices.

A few tests still use hard-configured tick rates, as they have
baked-in assumptions (like e.g. "a tick will be longer than a
millisecond") that need to be addressed first.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Johan Hedberg 0d9dab300e Bluetooth: Introduce separate pool for discardable events
Introduce a separate buffer pool for events which the HCI driver
considers discardable. Examples of such events could be e.g.
Advertising Reports. The benefit of having such a pool means that the
if there is a heavy inflow of such events it will not cause the
allocation for other critical events to block and may even eliminate
deadlocks in some cases.

Also update all mesh samples not to specify explicit RX buffer counts
anymore. Instead, create appropriate defaults in Kconfig so that we
only need to override this in the app for cases like the bbc:microbit
with limited memory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Johan Hedberg fc2fcd10cf Bluetooth: Add dedicated pool for HCI_Num_Completed_Packets HCI event
This event is a priority one, so it's not safe to have it use the RX
buffer pool which may be depleted due to non-priority events (e.g.
advertising events). Since the event is consumed synchronously it's
safe to have a single-buffer pool for it. Also introduce a new
bt_buf_get_evt() API for HCI drivers to simplify the driver-side code,
this effectively also deprecates bt_buf_get_cmd_complete() which now
has no in-tree HCI driver users anymore.

Fixes #16864

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Kumar Gala 284bc9d964 dts: Rename SW._GPIO_* -> DT_ALIAS_SW._GPIOS_*
We use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l SW._GPIO_CONTROLLER | xargs sed -i 's/SW\(.\)_GPIO_CONTROLLER/DT_ALIAS_SW\1_GPIOS_CONTROLLER/g'
git grep -l SW._GPIO_PIN | xargs sed -i 's/SW\(.\)_GPIO_PIN/DT_ALIAS_SW\1_GPIOS_PIN/g'
git grep -l SW._GPIO_FLAGS | xargs sed -i 's/SW\(.\)_GPIO_FLAGS/DT_ALIAS_SW\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-01 07:14:36 -05:00
Anas Nashif a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.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 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
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.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 e1e05a2eac cleanup: include/: move atomic.h to sys/atomic.h
move atomic.h to sys/atomic.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
Nicolas Pitre 659fa0d57d lifo/fifo: first word is not always first 4 bytes
The first word is used as a pointer, meaning it is 64 bits on 64-bit
systems. To reserve it, it has to be either a pointer, a long, or an
intptr_t. Not an int nor an u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-26 09:08:42 -04:00
Luiz Augusto von Dentz 4e6e2e3e85 Bluetooth: tests: Add tests for GATT
This adds initial test for GATT APIs that don't require a connection
thus can be run without any extra setup.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-24 22:36:59 +02:00
Luiz Augusto von Dentz 2dc2d9cf00 Bluetooth: tests: Add tests for L2CAP
This adds initial test for L2CAP APIs that don't require a connection
thus can be run without any extra setup.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-24 22:36:59 +02:00
Luiz Augusto von Dentz 72b05f3e17 Bluetooth: tests: Add tests for UUID APIs
This adds initial test for UUID APIs.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-24 22:36:59 +02:00
Luiz Augusto von Dentz 5846a36e9c Bluetooth: hci_prop_evt: Don't set NO_QEMU_SERIAL_BT_SERVER
It should no longer be needed to set NO_QEMU_SERIAL_BT_SERVER manually
when setting CONFIG_BT_NO_DRIVER.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-06-24 22:36:59 +02:00
Anas Nashif f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Asger Munk Nielsen 912e117e9e Bluetooth: Controller: Test for user extensions
With pull request #16208 and #16404 hooks for calling user defined
code was implemented. These user extensions are gated by a number of
Kconfigs. The test in this pull request tests that code compiles when
these Kconfigs are enabled.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-06-06 12:38:13 +02:00