Commit graph

624 commits

Author SHA1 Message Date
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Johan Hedberg a0c22de270 tests: bluetooth/tester: Convert from SYS_LOG to new logger
Use the LOG_* macros instead of the deprecated SYS_LOG_* ones.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg 343c53e841 Bluetooth: Switch from SYS_LOG to logger-based logging
Initial conversion to use syslog instead of logger.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Jakub Rzeszutko 147122e77f shell: examples unification
Updating examples according to new return value of function
shell_cmd_precheck.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-19 13:35:56 +02:00
Jakub Rzeszutko f6197c4f3c shell: create instances automatically basing on enabled backend
If user will enable shell than for each backend shell instance
will be created automatically.

Update all shell examples according to the new initialization
procedure.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-11 12:08:04 +02:00
Jakub Rzeszutko b0571746e2 shell: parsing output LF character
Some terminals literally interprets shell output data. Hence to print
a message in new line shell needs to send `\r\n` each time. To minimize
flash usage user can now send `\n` as a line delimiter and shell will
automatically add missing CR character.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-10 10:45:28 +02:00
Carles Cufi 94f8e75b24 tests: Bluetooth: shell: Whitelist nrf52840_pca10056
In order to fully cover the platform that supports most of the optional
features in the specification, whitelist the nRF52840 DK.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-10-03 11:03:21 -05:00
Luiz Augusto von Dentz 76714c1480 Bluetooth: Shell: Make error message for unknown parameter consistent
Also simplify it by having the 'unknown parameter:' as part of the
message format.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-03 09:49:58 +02:00
Luiz Augusto von Dentz 4058f724bc Bluetooth: samples: shell: Don't use printk
Make use of shell_fprintf whenever possible.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-03 09:49:58 +02:00
Jakub Rzeszutko c471614cb6 subsys: shell: fix accept either CR or LF as as line delimiter
1. Shell will accept CR or LF as line delimiter.
2. Macro SHELL_DEFINE simplified - it no longer requires
   new line character.
3. Fixes: #10207.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:55:47 -07:00
Jakub Rzeszutko 0eea1ef212 subsys: shell: add int ret_val to command handlers
1. Command handler can return command exectution status as int.
2. Existing command handlers rework.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Luiz Augusto von Dentz 592dd2e964 Bluetooth: shell: Port commands to the news shell
Fixes #8873

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-10-01 11:10:46 +02:00
Luiz Augusto von Dentz 3151d26572 Bluetooth: L2CAP: Add return to recv
This adds a int return to recv callback which can be used to notify the
stack about errors when receiving a packet. In addition to that the user
can return -EINPROGRESS to inform the stack the data will be processed
asynchronously which can be complete by calling
bt_l2cap_chan_recv_complete.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-09-24 12:51:11 +03:00
Krzysztof Chruscinski 527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Grzegorz Kolodziejczyk 734eda39f5 bluetooth: tester: Increase SDU size to meet PTS requirement
PTS test cases MESH/NODE/TNPT/BV-07-C, MESH/NODE/TNPT/BV-12-C, requires
to receive 8 segment of data which summary requires 108 bytes of SDU.
This patch make test cases PASSing.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-08-16 12:41:55 +03:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Johan Hedberg 7ec40e81d0 Bluetooth: shell: Add multiple identity support
Add shell support for creating and showing identities.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Johan Hedberg 5708f1e8b1 Bluetooth: Add infrastructure to handle multiple identities
Make it possible to have multiple identity addresses as an LE
peripheral. For central role only the default identity is supported
for now. This also extends the flash storage in a backward compatible
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Szymon Janc 504584a998 Bluetooth: att: Add option to disable GATT writable name
This allow to set name at runtime while leaving GAP name characteristic
read only.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2018-08-03 10:41:01 +02:00
Johan Hedberg b049ac1216 Bluetooth: shell: Add command for setting fixed passkey
Add a shell command to utilize the newly added bt_passkey_set() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-01 16:13:21 +03:00
Johan Hedberg d26e482dab Bluetooth: Mesh: Use more reasonable advertising buffer counts
The number of buffres influences e.g. the maximum SDU size, which in
turn influences call stack consumption. Use lower values where a high
number of buffers isn't necessary, and use the default (6) where it's
sufficient.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-25 18:16:45 +03:00
Luiz Augusto von Dentz e9e5115116 Bluetooth: shell: Add name command
name command can be used to read or write the GAP Device Name which is
used by the advertise command.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Anas Nashif 19666a9beb tests: fix u32_t type usage
We have been mixing u32_t and uint32_t. Using u32_t when the API expects
something else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-18 12:32:23 -04:00
Vinayak Kariappa Chettimada fdedc49a61 Bluetooth: tests: exclude btshell/mesh_shell on NRF52810_PCA10040
Exclude building the btshell and mesh_shell application for
NRF52810_PCA10040 boards due to limited RAM and Flash
availability on the nRF52810 SoC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-06-27 16:09:58 +02:00
Mariusz Skamra aa190cd5b5 bluetooth: tester: Set configuration file for qemu_cortex_m3 target
qemu.conf will be chosen by default for qemu_cortex_m3.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-15 13:42:09 +02:00
Mariusz Skamra 3904442e6b bluetooth: tester: Remove redundant config option from qemu.conf
UART_PIPE_ON_DEV_NAME is set to UART_1 by default in
boards/arm/qemu_cortex_m3/qemu_cortex_m3.dts

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-15 13:42:09 +02:00
Mariusz Skamra 37e6162c47 bluetooth: tester: Fix bt_gatt_service_register call with invalid params
This fixes an assert
ASSERTION FAIL [svc->attr_count] @ subsys/bluetooth/host/gatt.c:259:
	invalid parameters
caused by bt_gatt_service_register call with invalid (uninitialized)
services array.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-15 13:42:09 +02:00
Mariusz Skamra bb4ed94c60 bluetooth: tester: Increase system workqueue stack size
This fixes an issue of system workqueue stack overflow that was
was observed during Bluetooth Mesh automated testing.
Increase system workqueue stack to avoid MPU faults.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Fixes #8262
2018-06-12 16:51:26 +02:00
Johan Hedberg 8d1f67c605 Bluetooth: Remove references to non-existing Kconfig symbols
Remove non-existent Kconfig symbol references. An additional (but
related) change is the removal of all persistent storage symbols from
the Arduino 101 Bluetooth shell app, since BT_STORAGE no longer
exists.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-23 16:57:59 -04:00
Andrew Boie 8e57097eac bluetooth: disable user mode for one test
This is a workaround until #7704 is fixed, we are getting
an assembler error due to the r7 clobber in the syscall
invocation macros.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-22 15:59:07 -07:00
Jan Van Winkel ca16779d9e driver: ILI9340 LCD display driver
Minimal driver for ILI9340 LCD display driver including support
for adafruit 2.2" LCD display (1480)

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-05-18 20:21:45 +03:00
Johan Hedberg cfb34d2b80 Bluetooth: Mesh: shell: Add persistent storage support
Add persistent storage support to the mesh shell module and app.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-16 18:41:23 +03:00
Luiz Augusto von Dentz 1b038f2941 Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value
This ensures the every characteristic has a value attribute declared
with the same UUID since the old macro did not declare the value the
application would normally have to declare one itself using a different
UUID which is not allowed.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-05-14 18:51:22 +03:00
Johan Hedberg 88dfd399f4 Bluetooth: Mesh: Remove sequence number from bt_mesh_provision()
The sequence number was acting as a stop-gap for missing persistent
storage. Now that we have the settings support in place it's no longer
needed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg 8703ffad23 Bluetooth: Mesh: Redesign element and storage info for models
Keeping the model struct same sized, change the element pointer to two
indexes, and add a flags member that will be used to track pending
storage actions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg a29554360a Bluetooth: shell: Add settings support
Enable settings and increase the system workqueue size to deal with
the stack usage. This also makes it possible to test unpairing support
with the shell's 'clear' command.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Johan Hedberg d22b7c9f2d Bluetooth: Remove bt_storage API
The same functionality is now supported by the settings-based
solution, so remove bt_storage out of the way. There were stubs in
bt_storage to handle per-peer information (e.g. pairing keys) but this
was never actually implemented in full. The next step is to add this
support to the settings-based solution.

Leave the code for generating temporary IRK and identity address in
case BT_SETTINGS is not enabled. Also leave the code for using vendor
HCI to read the identity address, in which case the settings
implementation will not touch it.

Introduce a new bt_unpair() API to replace the removed
bt_storage_clear(), since the latter was actually doing more than just
storage management: it was also handling runtime storage of pairing
information. Later, the bt_unpair() implementation will be extended to
clear settings-based pairing storage.

There is one feature that the bt shell module looses: the ability to
give a specific identity address to the "init" command as a parameter.
We might look later in the future if this is really needed, and add a
separate API for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Anas Nashif d7e7b08cdc tests: cleanup meta-data of various tests
Use sensible test name and cleanup filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif 66d60d2941 boards: delete arduino_101_ble board
This board is the same as curie_ble, so remove duplication and have only
one board definition.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-23 16:21:16 -04:00
Carles Cufi 8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Paul Sokolovsky 6b7435b85d tests: bluetooth: shell: Set min_flash to 145K
With recent master, this sample started to overflow ROM area of
arduino_101, which has 144K of it:

Memory region         Used Size  Region Size  %age Used
             ROM:      149420 B       144 KB    101.33%
             RAM:       26228 B        52 KB     49.26%
        IDT_LIST:         564 B         2 KB     27.54%
        MMU_LIST:          0 GB         1 KB      0.00%

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-16 13:44:06 -07:00
Mariusz Skamra fd2124913c Bluetooth: btp: Add Enable advertising with Node Identity cmd
This adds Enable advertising with Node Identity BTP command and
it's implementation.
This command is needed to pass PTS MESH/NODE/CFG/NID/BV-02-C
test case.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-03-10 11:56:22 +02:00
Mariusz Skamra c2d7c8579d Bluetooth: btp: Add missing Clear Replay Protection List Cache cmd
This command has been agreed and implemented in tester application.
The patch updates BTP document only.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-03-10 11:56:22 +02:00
Johan Hedberg b9588d8eb6 Bluetooth: Mesh: Switch to using Linux Foundation Company ID
The Linux Foundation now has an assigned Company Identifier, so switch
to using that.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-05 19:54:21 -05:00
Johan Hedberg ac1360f0a7 Bluetooth: Mesh: Convert to new net_buf_simple APIs
Convert the mesh code to use the new net_buf_siple APIs. This has the
benefit of saving 4 bytes off the stack due to the not needed pointer.
Also update the publication context helpers to map to the new
net_buf_simple API in an intuitive way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-13 14:00:08 +02:00
Luiz Augusto von Dentz 800bfaf9a7 Bluetooth: UUID: Remove macros defining 16 bit values
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.

Fixes #5162

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 13:33:48 +02:00
Alberto Escolar Piedras 6ef85ed6fc test: shell: native_posix also supports shell
The native_posix port also supports shell apps thru its
stdin redirection.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-02 07:48:46 -08:00
Johan Hedberg b072de3b1e Bluetooth: mesh_shell: Increase L2CAP TX buffer count
In case of split host & controller we may need to do ACL segmentation
of packets. Sending the composition data will already have allocated
three TX buffers, so trying to segment the first one further will
result in a deadlock. Increase the buffer count from the default (3)
to 4 to work around this risk.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-01 16:51:11 +01:00
Vinayak Kariappa Chettimada 5f4a7ea119 Bluetooth: shell: Support a non-connectable build
Add conditional compilation and move code to support
building a non-connectable Bluetooth shell application.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-01-25 10:51:54 +02:00
Mariusz Skamra 834ab2c192 Bluetooth: tester: Fix device connected and disconnected events
This fixes parameters order in events to be BTP compliant.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-23 12:30:29 +02:00
Mariusz Skamra a6cfda8d64 Bluetooth: btp: Fix address in GAP Device Found event
This event had address and address type parameters swapped
in it's structure.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-23 12:30:29 +02:00
Alberto Escolar Piedras 4c1d8029b4 tests: bluetooth/bluetooth fix for boards with a controller
Fix in the prj.conf so the test will also work in boards which
by default compile a BT controller.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-17 12:41:06 +02:00
Mariusz Skamra 83f5c3365e Bluetooth: tester: Fix uart-pipe build error on nrf52840 board
This fixes build error due to undeclared CONFIG_UART_PIPE_ON_DEV_NAME
on nrf52840 board.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-16 14:41:23 +02:00
Mariusz Skamra bf58fb481b Bluetooth: tester: Add Configuration and Health Client models
PTS requires the composition data of size that cannot be sent in
single PDU. This patch adds Configuration and Health Client models
to the root_models to increase the Elements size in Composition Data
Page 0.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-12 15:10:24 +02:00
Alberto Escolar Piedras 095300a3e1 tests: bluetooth/bluetooth can also be run in native_posix
The bluetooth/bluetooth can also be run in the native_posix
board

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-11 18:01:01 -05:00
Mariusz Skamra a45e18ec2e Bluetooth: tester: Set BT_MESH_LABEL_COUNT
This is required to run tests related to Virtual Addresses

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-09 10:29:10 +02:00
Anas Nashif 829598be2b tests: add CONFIG_TEST for marking tests
Mark tests with CONFIG_TEST to allow for test specific setup and
configuration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 10:03:57 -05:00
Mariusz Skamra 0083634f73 Bluetooth: tester: Increase Mesh model group count
BT_MESH_MODEL_GROUP_COUNT has to be increased to meet the
PTS requirements.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-05 18:53:42 +02:00
Mariusz Skamra 9d6bb0995c Bluetooth: tester: Do not start LPN automatically
This disables CONFIG_BT_MESH_LPN_AUTO flag in Kconfig.
LPN is enabled by calling BTP Low Power Node command
if requested.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-04 15:03:33 +01:00
Mariusz Skamra 813ec50838 Bluetooth: btp: Add event indicating expiration of incomp timer
This event indicates that segmented message incomplete timer
expired.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra 8274cbabf6 Bluetooth: btp: Add Mesh Clear Replay Protection List Cache command
This command is needed for Bluetooth Mesh testing against PTS.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra a909aa3a0b Bluetooth: btp: Add LPN Subscribe/Unsubscribe commands
This adds commands to manage Friend node Subscription List.
Those will be used to add or remove and group/virtual address
from subscription list.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra 0bd3790d5b Bluetooth: btp: Add event indicating invalid provisioning BearerOpcode
This adds BTP event indicating reception of provisioning message
with invalid (RFU) BearerOpcode.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra 083937be32 Bluetooth: tester: Do not send BTP error if fault_update failed
This may fail, if model publication was not set by remote.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra 0d71cef1f2 Bluetooth: tester: Add BTP Mesh Model Send command implementation
This command will be used to test if model can properly send
segmented and unsegmented messages to a given destination address.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Paul Sokolovsky e25df54eae various: Update/fix some textual material and code comments.
Of these, only struct net_ipv6_nbr_data::send_ns is a descriptive
change:

send_ns is used for timing Neighbor Solicitations in general, not
just for DAD.

The rest are typo/grammar fixes.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-12-29 09:45:39 -05:00
Anas Nashif d4784555d0 tests: remove build_only option
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Mariusz Skamra 3e8a5bc72f Bluetooth: tester: Add Core Unregister Service command
This adds stubs for Core Unregister Service command implementation.
It will be used to clean up the stack and tester after test case
execution.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-19 15:43:43 +01:00
Mariusz Skamra 16fbf25ceb Bluetooth: tester: Add Mesh Health Model related commands
This adds Mesh Health Model related commands implementation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-19 12:12:00 +01:00
Mariusz Skamra 2f5d1f7a30 Bluetooth: tester: Add Mesh Network Received event
This adds implementation of Mesh Network receive event.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-18 12:43:23 +01:00
Mariusz Skamra c5a04fad64 Bluetooth: tester: Add Mesh Network Send command
This adds Mesh Network Send command implementation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-18 09:37:31 +01:00
Mariusz Skamra 244e9564ac Bluetooth: tester: Add Mesh IV Update related commands
This adds Mesh IV Update related command handlers implementation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-15 11:10:54 +02:00
Mariusz Skamra c20af89020 Bluetooth: tester: Fix not checking btp2bt_uuid return value
btp2bt_uuid might return BTP_STATUS_FAILED. Procedure shall be aborted
in this case.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 11:18:32 +02:00
Mariusz Skamra 78aa543d6f Bluetooth: tester: Fix attribute uuid type check
This chack shall be performed on attribute uuid type, not uuid provided
in Gatt Get Attributes command paramteres.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 11:18:32 +02:00
Mariusz Skamra 1e8b9766dc Bluetooth: tester: Add implementation of Mesh LPN related BTP commands
This adds implementation of Mesh LPN and Mesh LPN Poll commands.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 10:07:46 +02:00
Mariusz Skamra 4dd2ae56f2 Bluetooth: btp: Introduce Health Generate/Clear Faults commands
Those commands will be used for qualification purposes to verify
the functionality of Mesh Health Model.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 09:30:12 +02:00
Mariusz Skamra e7a6b2d047 Bluetooth: btp: Add Mesh Network receive event
This event is needed for qualification purposes to verify functionality
of Mesh Network layer.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 09:30:12 +02:00
Mariusz Skamra 581d6c3158 Bluetooth: btp: Add BTP Mesh Network Send command
This command will be used to verify functionality of the network
layer against PTS.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 09:30:12 +02:00
Mariusz Skamra 090444829f Bluetooth: BTP: Add BTP MESH IV Update related commands
This commands will be used while testing IV Update procedure
against PTS.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-13 09:30:12 +02:00
Mariusz Skamra 589a5dad17 Bluetooth: tester: Add initial support for BTP Mesh service
This adds initial implementation of BTP Mesh service.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-12 12:44:21 +02:00
Mariusz Skamra 48465c5eaf Bluetooth: btp: Add Mesh LPN related commands
Extend BTP with Mesh LPN related commands.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-12 10:29:20 +02:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Mariusz Skamra da68167331 Bluetooth: btp: Add events indicating provisioning link state
This introduced two BTP events to indicate provisioning link state.
This is needed for testing purposes, since PTS requests tester to
confirm link state.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-11 13:52:05 +02:00
Mariusz Skamra 85f16efbeb Bluetooth: tester: Add Get Attribute Value command implementation
This procedure will be used to query GATT Server for attribute value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-09 09:25:04 +02:00
Mariusz Skamra c168769b95 Bluetooth: btp: Add GATT Get Attribute Value command
This procedure will be used to query GATT Server for attribute value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-09 09:25:04 +02:00
Mariusz Skamra 444b2ad21e Bluetooth: tester: Add Get Attributes command implementation
This procedure is used query local GATT Server for attributes
based on given search pattern. Attributes can be searched using
Attribute Handle range and Attribute Type.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-09 09:25:04 +02:00
Mariusz Skamra 55fe397853 Bluetooth: btp: Add GATT Get Attributes command
This will be used for verification in GATT test cases.
This procedure is used query local GATT Server for attributes
based on given search pattern. Attributes can be searched using
Attribute Handle range and Attribute Type.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-12-09 09:25:04 +02:00
Johan Hedberg 7909c3d3fa Bluetooth: Mesh: Introduce option for Node ID timeout
Some PTS test cases only work when we're advertising using Network
Identity. Using the default timeout of 60 seconds for Node Identity
will cause this test cases to fail (i.e. the PTS gives up before
Zephyr transitions to advertising from Node Identity to Network
Identity).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-28 17:17:48 +02:00
Johan Hedberg 48aecd1513 Bluetooth: Mesh: Add IV Update test mode API
This makes it possible to pass all IV Update tests without having to
build a custom configuration for some of the tests. We also disable
the feature in all sample configurations, but leave it on in the
tests.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-27 10:17:54 +02:00
Johan Hedberg 7ef5e53e28 Bluetooth: Mesh: Add skeleton for Health Client model
Add a skeleton for the Health Client model.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-23 14:49:55 +02:00
Vinayak Kariappa Chettimada 021bda962c Bluetooth: tests: Fix config option dependencies
With the introduction of controller's advanced features
Kconfig option, some of the dependent options where not
enabled in the init tests build. Fixed by enabling the
advanced features Kconfig options.

Also, updated conf files to reflect latest set of Kconfig
options supported by the Bluetooth controller subsystem.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-11-22 18:48:05 -05:00
Johan Hedberg 5e7c5815af Bluetooth: tests/mesh_shell: Tweak configuration a little bit
The generic Bluetooth shell was never intended to be enabled. Also
make the default advertised name a bit nicer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 13:31:58 +02:00
Johan Hedberg 5633ec0413 Bluetooth: tests/mesh_shell: Fix main stack size for qemu
The qemu main() seems to require more stack than the arm equivalent.
Increase the stack size to 320 to avoid crashes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg 9c0b00195c Bluetooth: tests/mesh: Fix model publication
The app was declaring model publication contexts but missing buffers
for the publication messages.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg 8f1541184f Bluetooth: Mesh: Fix non-periodic Model Publication
The only generally available model supporting publication that's
convenient to be used for testing is the Health Server Model.
Unfortunately since this model supports period publication, the
non-periodic side got less attention and had some bugs.

The first thing that needs to be done is to verify that the period
returned by bt_mesh_model_pub_period_get() is positive. If it's zero
then no periodic publication should take place.

Another thing that this patch cleans up is the naming of the callback
used for periodic publishing. There's no need do require the callback
to call bt_mesh_model_publish() since this must happen no matter what,
so instead rename the callback from 'func' to 'update' and have the
access layer call bt_mesh_model_publish() if the callback was
successful.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg 9a5fd64a31 Bluetooth: tests/shell: Move mesh into its own configuration
Trying to always include mesh support resulted in the app not fitting
on some boards (e.g. nrf51_pca10028). Put the mesh-specific
configuration in a separate configuration file instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00
Johan Hedberg 07befaa2fe Bluetooth: tests: Add new mesh_shell app
Having a dedicated Mesh shell app instead of extending the existing
shell app will let us fine-tune board-specific configurations for Mesh
in the future (not to mention that extending the shell app already
resulted in it not fitting on some boards).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00
Johan Hedberg e7bb76e2b6 Bluetooth: Mesh: Fix model publication
Model publication was broken in a couple of ways:

 - The Publish Retransmit State was not taken into account at all
 - Health Server used a single publish state for all elements

To implement Publish Retransmit properly, one has to use a callback to
track when the message has been sent. The problem with the transport
layer sending APIs was that giving a callback would cause the
transport layer to assume that segmentation (with acks) is desired,
which is not the case for Model Publication (unless the message itself
is too large, of course). Because of this, the message sending context
receives a new send_rel ("Send Reliable") boolean member that an app
can use to force reliable sending.

Another challenge with the Publish Retransmit state is that a buffer
is needed for storing the AppKey-encrypted SDU once it has been sent
out for the first time.To solve this, a new new net_buf_simple member
is added to the model publication context. The separate 'msg' input
parameter of the bt_mesh_model_publish() API is removed, since the
application is now expected to pre-fill pub->msg instead.

To help with the publishing API change, the Health Server model gets a
new helper macro for initializing the publishing context with a
right-sized publishing message.

The API for creating Health Server instances is also redesigned since
it was so far using a single model publishing state, which would
result in erratic behavior in case of multiple elements with the
Health Server Model. Now, the application needs to provide a unique
publishing context for each Health Server instance.

The changes are heavily intertwined, so it's not easily possible to
split them into multiple patches, hence the large(ish) patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00
Johan Hedberg a18a22524f Bluetooth: Mesh: shell: Add mod-pub command
Add a command for getting and setting the model publication. We also
have to adjust the app's configuration, since both the Model
Publication Set and Status messages are segmented messages, meaning we
need two TX and RX segment contexts.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Johan Hedberg 255edcfde2 Bluetooth: Mesh: Provisioning: Add NetKeyIndex to complete callback
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 70cbcef576 Bluetooth: Mesh: Rename health server code from health to health_srv
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 3b252ca2be Bluetooth: Mesh: Rename configuration server code from cfg to cfg_srv
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 0ef7c6e09a Bluetooth: Mesh: Add more flexible APIs for provisioning bearers
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg a81fa43a59 Bluetooth: Mesh: Use proper _t suffix for typedefs
To be consistent with the coding style, use a _t suffix for typedefs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg 588887c9b7 Bluetooth: Mesh: Add primary address to provisioning complete callback
It may be useful for the app to know that the local node's primary
address is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Johan Hedberg 2a1e16c2a3 Bluetooth: Mesh: Add skeleton for Configuration Client Model
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Johan Hedberg e2e74f705b Bluetooth: Mesh: shell: Add basic skeleton
Add a basic shell skeleton for Mesh, containing basic command for
initialization, provisioning and reset.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 11:03:58 +02:00
Johan Hedberg af512e5498 Bluetooth: tests/shell: Rename Arduino 101 conf file for cmake
The conf file name must be of the form prj_<board>.conf for it to be
automatically chosen for a given board.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 15:10:20 +02:00
Johan Hedberg 9bdd8d6b60 Bluetooth: tests: Update tester documentation for cmake
Remove references to make-centric build process, and refer to the
steps in a more neutral way (which is equally applicable to using
either make or ninja as the generator type).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-12 15:05:49 +02:00
Johan Hedberg a30d876a6c Bluetooth: tests: Remove explicit setting of QEMU_EXTRA_FLAGS
The needed options to QEMU_EXTRA_FLAGS now get set from a single
central place, so applications don't need to do it anymore.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-12 15:05:49 +02:00
Johan Hedberg 6249ae7cda Bluetooth: tests/mesh: Update lpn.conf with saner defaults
Use the default values for scan latency and receive delay, and enable
useful logging, like that for LPN.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 22:17:43 +03:00
Johan Hedberg 58b476fb33 Bluetooth: tests/mesh: Remove manual LPN enabling
The default of the stack is now to automatically enable LPN
functionality after a given timeout.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 22:17:43 +03:00
Szymon Janc 1a50ee1fe0 Bluetooth: btp: Add initial commands for Mesh service
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-11-10 14:44:23 +02:00
Sebastian Bøe c7832bd343 cmake: Use -serial bt-server when CONFIG_BT
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Johan Hedberg 3a0b1b435e tests: bluetooth/mesh: Enable beacon by default
There are some PTS tests, which expect the IUT to send some beacons
after provisioning, so enable the feature by default.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-07 18:59:06 +03:00
Johan Hedberg a022e950b5 Revert "tests: mesh: Convert legacy test to use ztest"
This reverts commit b66a6acad7.

The mesh test app is (at least for now) only supposed to be manually
run. It e.g. contains special configurations for feature-specific
testing using the Bluetooth PTS.

The ztest conversion that was done to the app doesn't really make any
sense since nothing of essence is tested by the ztest hooks and
everything that the app intends to be tested need manual action either
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-06 13:22:24 -05:00
Mariusz Skamra f1753ae0f3 Bluetooth: tester: Add Attribute Value Changed event implementation
This adds implementation of previously introduced BTP event.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 21:28:14 +03:00
Mariusz Skamra 204c468d16 Bluetooth: btp: Add new event to indicate GATT attribute value change
Attribute Value Changed Event will be used to indicate characteristic
or descriptor value change in local GATT Server database.
Event will be triggered when PTS performed ATT Write operation
successfully.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 21:28:14 +03:00
Mariusz Skamra 4d831a7bdd Bluetooth: tester: Fix include service attribute user data
GATT Server:
According to the API, include service declaration user data
points to the first service attribute to include.

bt_gatt_include structure is valid only for client role.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2017-10-17 17:30:50 +03:00
Anas Nashif d411eca92f tests: Bluetooth: simplify BT init test
Use common keys and simplify. Remove stray tmp file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Anas Nashif c6a8014e1c subsys: fs: consolidate elm FAT kconfig options
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 08:43:50 -04:00
Johan Hedberg d712a4e1a3 Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0:

    "A node shall implement a Local Network Interface."

Removing the Kconfig option also helps clean up quite a lot of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-27 16:33:06 +03:00
Punit Vara b66a6acad7 tests: mesh: Convert legacy test to use ztest
This test case makes this test case use ztest apis and
adds CONFIG_ZTEST in all configuration

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Punit Vara 7ce27c6b49 tests: bluetooth: Use ztest apis
This patch converts legacy test case to use ztest apis.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Punit Vara c4c5eabc61 tests: init: use ztest APIs
This patch converts legacy test case to use ztest apis.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-13 09:48:34 -04:00
Ruslan Mstoi 47f4af4310 Bluetooth: tester: Fix bt-stack-tester to unix domain socket
/tmp/bt-stack-tester is not a pipe, but unix domain socket.
This commit fixes respective "make run" errors:

qemu-system-arm: -serial pipe:/tmp/bt-stack-tester: Could
not open '/tmp/bt-stack-tester': No such device or address

qemu-system-arm: -serial pipe:/tmp/bt-stack-tester: could
not connect serial device to character backend
'pipe:/tmp/bt-stack-tester

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2017-09-07 05:53:01 -05:00
Savinay Dharmappa 3c9fb93dc5 tests: bluetooth: tester: Make UART usage consistent
We use UART1 for UART pipe in a number of qemu tests, so lets do the
same thing for the bluetooth test and move the bluetooth uart to UART2.

Jira: ZEP-2412.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-08-30 10:07:07 -05:00
Carles Cufi b7a5fab4cf Bluetooth: controller: Add Read Static Addresses VS command
Implement the first Vendor-Specific Command of the Zephyr specification
other than the 3 mandatory ones already present in the codebase, along
with a Kconfig option to enable and disable the presence of the VS
commands.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-30 08:18:42 -04:00
Luiz Augusto von Dentz d229ec07ad Bluetooth: tester: Fix using invalid elements with k_fifo
The documentation of k_fifo_put mentions that the items must have 32
bits reserved for kernel use as that is where the sys_snode_t pointer
is placed but this detail was not taken into consideration when
designing the cmd_queue which access each element as a btp_cmd.

Note: This probably used to work just because k_fifo_get used to place
data directly into thread's swap_data so the kernel never really touched
the list but with the changes to use k_poll the list is always updated
exposing this issue.

Jira: ZEP-2568

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-30 08:16:16 -04:00
Luiz Augusto von Dentz 26cd8cefd1 Bluetooth: shell: Enable CONFIG_BT_SHELL for arduino_101
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-25 15:32:38 -04:00
Vinayak Kariappa Chettimada 6a39ed084f Bluetooth: controller: Add Minimum Number of Used Channels Proc
Add implementation to support Bluetooth 5.0 Minimum Number
of Used Channels Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-08-21 08:41:56 -04:00
Carles Cufi fc965e5554 Bluetooth: controller: Split Ext Scan Filter Policies out
Since Extended Scanner Filter Policies is an independent feature from
Controller-based Privacy, split it out so it can be built independently
and included without it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-15 22:55:15 +03:00
Carles Cufi d5c13a7530 Bluetooth: controller: Rename Kconfig prefix
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-14 15:44:56 +03:00
Johan Hedberg 2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Johan Hedberg bf8e504588 Bluetooth: Mesh: Fix duplicate const declarations
Remvoe duplicate const declarations which may cause compiler warnings.

Jira: ZEP-2442

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-07 19:18:02 +03:00
Inaky Perez-Gonzalez 3d498dd10c build: workaround build bug in tests
When an app uses a construct such as:

obj-y = main.o ../../../../samples/bluetooth/gatt/hrs.o

in its makefile, it causes said object module to be built in the
source tree, not in the object tree.

When building massively parallel, this usually resuls on the files
getting corrupted, leading to bugs such as:

https://jira.zephyrproject.org/browse/ZEP-2316
https://jira.zephyrproject.org/browse/ZEP-2317

src/../../../../samples/bluetooth/gatt/.gap.o.cmd:3: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:4: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:5: *** missing separator.  Stop.

as multiple build are trying to touch the same file in the source tree
and of course, race and causes a build bug.

We have known about this issue for a long time, but it requires
modifications in the build system that there is no time to tackle.

A suggested workaround is to include the source files into a local .c
file, so this is what this patch does, to remove the random noise.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Johan Hedberg 0ec2630882 Bluetooth: Mesh: Add initial implementation
Add an initial implementation for the Bluetooth Mesh Profile
Specification. The main code resides in subsys/bluetooth/host/mesh and
the public API can be found in include/bluetooth/mesh.h. There are a
couple of samples provided as well under samples/bluetooth and
tests/bluetooth.

The implementation covers all layers of the Bluetooth Mesh stack and
most optional features as well. The following is a list of some of
these features and the c-files where the implementation can be found:

 - GATT & Advertising bearers (proxy.c & adv.c)
 - Network Layer (net.c)
 - Lower and Upper Transport Layers (transport.c)
 - Access Layer (access.c)
 - Foundation Models, Server role (health.c & cfg.c)
 - Both PB-ADV and PB-GATT based provisioning (prov.c)
 - Low Power Node support (lpn.c)
 - Relay support (net.c)
 - GATT Proxy (proxy.c)

Notable features that are *not* part of the implementation:

 - Friend support (initial bits are in place in friend.c)
 - Provisioner support (low-value for typical Zephyr devices)
 - GATT Client (low-value for typical Zephyr devices)

Jira: ZEP-2360

Change-Id: Ic773113dbfd84878ff8cee7fe2bb948f0ace19ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-20 09:30:44 +03:00
David B. Kinder eeed8ce179 doc: fix wiki board references in non .rst files
Some README files referenced wiki articles that have been
moved to the doc area on the website.

Fixes #668

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-07-11 12:45:35 -05:00
Johan Hedberg 30beef9419 Bluetooth: GATT Introduce BT_GATT_CCC_MAX helper define
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-04 17:30:40 +03:00
Johan Hedberg 7a79101fd5 Bluetooth: tests: Remove unused prj_nimble.conf files
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-03 08:22:58 -04:00
Anas Nashif d1e562c924 tests: replace filters in testcase files
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Andrzej Puzdrowski 8b7a8448ab Drivers: flash: NRF5x: synchronous mode for co-operation with BLE radio
In added mode flash operation are performed in timeslice
(in radio idle time).
Kconfig for mode enabling CONFIG_SOC_FLASH_NRF5_RADIO_SYNC.

Erase and write API implementations were rewritten and preserved against
concurrent execution.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-28 12:29:50 +02:00
Johan Hedberg e094560dbc Bluetooth: tests: Fix left-over issues from bt_gatt_service() removal
The new GATT service registration API is bt_gatt_service_register(),
which takes a bt_gatt_service object pointer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-27 19:10:43 -04:00
Anas Nashif 6ff291a174 tests: do not exclude quark_d2000_crb
quark_d2000_crb does not build net/bluetooth tests by default now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Vinayak Kariappa Chettimada 46f9489704 Bluetooth: controller: Add radio fast ramp feature
Added implementation to use nRF radio's fast ramp up mode.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-22 18:48:15 +03:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Carles Cufi 4053470f62 Bluetooth: controller: Add inital support for Controller-based privacy
This initial commit adds the following:

* Handling of privacy HCI commands
* New Link Layer filter module for both whitelist and resolving list
* Advertising RPA generation with timeouts

Follow-up commits will expand the functionality.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-20 15:20:09 +03:00
Anas Nashif 2d970a2cbd tests: rename test directory test_bluetooth -> bluetooth
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-17 10:34:24 -04:00
Luiz Augusto von Dentz 79af35991b Bluetooth: GATT: Add bt_gatt_register_service
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz d837a6ec4b Bluetooth: GATT: Add GAP service by default
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz b3cfabab63 Bluetooth: Remove CONFIG_BLUETOOTH_GATT_DYNAMIC_DB
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Vinayak Kariappa Chettimada 51d6bdb2ff Bluetooth: controller: LE Advertising Extensions PDU structs
Add Bluetooth v5.0 LE Advertising Extensions air interface
packet structures.

Jira: ZEP-2073

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-14 18:40:40 +03:00
Andrew Boie 15ed8ec7ea tests: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Luiz Augusto von Dentz e1a062e28b Bluetooth: shell: Use CONFIG_BLUETOOTH_SHELL
Remove existing commands supported by CONFIG_BLUETOOTH_SHELL and make
sure all .conf select it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00
Johan Hedberg 9516d63836 Bluetooth: Remove support for NBLE
NBLE has been deprecated for a few releases now and can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-25 09:03:16 -07:00
Vinayak Kariappa Chettimada a7afc75c8a Bluetooth: shell: Add GATT write cmd throughput measurement
Add shell command to test GATT write cmd throughput between
two test shell peers.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-16 15:30:51 +03:00
Luiz Augusto von Dentz 4f019eab26 Bluetooth: shell: Remove forward declaration
It is possible to remove the forward declaration of l2cap_alloc_buf as
the recv pointer can be compared directly with chan pointer avoiding
using l2cap_ops directly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-14 17:54:46 +03:00
Vinayak Kariappa Chettimada 9fd04ea272 Bluetooth: shell: Add L2CAP throughput measurement
Added l2cap-metrics command to shell application which will
collect the rx-ed L2CAP CoC throughput.

Usage (local shell):
> l2cap-register <chan>
> l2cap-metrics on

  From peer shell:
  > l2cap-connect <chan>
  > l2cap-send 10

> l2cap-metrics
l2cap rate: 119225 bps.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-14 11:19:27 +03:00
Vinayak Kariappa Chettimada 5effd68a9d Bluetooth: controller: Fix tests conf file to cover new features
Updated tests conf file with coverage for new feature Kconfig
options in the Controller. This is required to catch compile/
build regression.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-12 13:55:39 +03:00
Andrew Boie 68d3678abb tests: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Vinayak Chettimada fc6d8d1bc4 Bluetooth: controller: Scan Request Notifications
Implement the framework for LE Scan Request Received Event.
The feature is available under the Controller's advanced
features and will be selected implcitly when Bluetooth v5.0
LE Advertising Extensions feature is implemented.

Jira: ZEP-2073

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-05-05 15:56:04 +03:00
Carles Cufi a1ff1a0933 Bluetooth: Consolidate flow control Kconfig
Since Controller to Host flow control is a feature that affects both
sides equally, move it to the top-level Kconfig file and consolidate its
use in both Controller and Host.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-04 18:09:31 +03:00
Luiz Augusto von Dentz ad4bb37b17 Bluetooth: shell: Fix deadlock when receiving L2CAP packet
The TX and RX pool needs to be split otherwise the TX code path may
consume all buffers causing the RX thread to deadlock which will
possible deadlock the TX thread as well in case it needs more credits.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-04 08:36:12 +03:00
Carles Cufi 7ebe7da736 Bluetooth: controller: Controller to Host flow control
The Bluetooth Specification allows for optional Controller to Host flow
control based on the same credit-based mechanism as the Host to
Controller one. This is particularly useful in 2-chip solutions where
the Host and the Controller are connected via a physical link (UART, SPI
or similar) where the Host is sometimes required to ask the Controller
to throttle its data traffic while still making sure that relevant
events get through the line.

This implementation is based on a simple queue of pending events and
data that is populated whenever the Controller detects that the Host is
out of buffers and then emptied whenever the Host notifies the
Controller that is ready to receive data again. Events relevant to the
connections are also queued to preserve the order of arrival.

At this point the Controller ignores the connection handle sent by the
Host and treats all connections equally, and it also queues events even
for connections that have no data pending in the queue. Both this items
can be improved if necessity arises.

Note that Number of Completed Packets will still flow freely from the
Controller to the Host regardless of the pending ACL data packets, which
might lead to inconsistencies in the sequential order of certain
operations that include bi-directional data transfer.

Jira: ZEP-1735

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-03 22:23:42 +03:00
Luiz Augusto von Dentz a03e068b03 Bluetooth: shell: Don't attempt to reuse channel
If the channel is already in use don't attempt to connect it a second
time.

Change-Id: I87bdaeadbe866b59c1a7975002699d9ef7a90c61
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-29 11:39:13 -04:00
Kumar Gala eaaa175b92 tests: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I6c676bc6c5e850a8725785554cd535e32067f33e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:49 -05:00
Kumar Gala 3c454017b4 Merge "Merge bluetooth branch into master" 2017-04-20 16:55:36 +00:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Vinayak Chettimada 392b5deacb Bluetooth: controller: Channel Selection Algorithm #2
Add Bluetooth 5.0 LE Channel Selection Algorithm #2 feature

Jira: ZEP-2033

Change-id: Ic1155b4399882b89cab33cac78b08b7b39ff6f9d
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-20 08:58:09 +03:00
Milosz Wasilewski deea71b3c6 tests: added TC_START to tests
TC_START was missing from some tests. For this reason automated testing
parsing wasn't unified for all tests. This patch fixes the issue and adds
TC_START to tests where it was missing.

Change-Id: I7e27a3fd8eaef9c3d0b0e0aeba9bca5b97eb0c58
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
2017-04-13 12:08:14 +00:00
Johan Hedberg ba7b6b1ced Bluetooth: tests/shell: Limit BR/EDR configuration to Qemu for now
The BR/EDR configuration doesn't fit e.g. the Arduino 101 anymore.
Limit it to Qemu for the time being, which is anyway the primary
target where the functionality is being tested.

Change-Id: I9a34c82157d56079e43acabe29eeadd6d99e03fe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-09 19:05:34 +03:00
Carles Cufi b37f743a13 Bluetooth: test: Add "tiny" controller configuration
Add a configuration that strips the BLE controller down to its simplest
form to catch any issues when commonly used options are not enabled.

Change-Id: Ifbec01d62b7d45fe9139dadaba734eff3b7a72b6
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-04-08 20:11:55 +03:00
Carles Cufi 27e83660ff Bluetooth: controller: Implement scan duplicate filter
Implement the controller's ability to drop duplicate advertising reports
when instructed by the Host.

Jira: ZEP-1246

Change-Id: I2d1b7abf1ed950dde705e5df30a858c595f3834c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada 7c22073195 Bluetooth: controller: Make worker and job priority configurable
Add Controller advanced Kconfig options to select IRQ
priorities of the Radio, Ticker's Worker and JOB IRQs.

This will provide an opportunity to have peripheral IRQ's
of higher level than Bluetooth Controller.

Change-id: Iaa128c1cd64a309a77d42d485fdefe68f31e4895
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada f38d57cba3 Bluetooth: controller: Kconfig option for advanced scheduling
Add Kconfig option to enable advanced scheduling in the
controller.

Enable non-overlapping placement of observer, initiator and
master roles in timespace. Uses window offset in connection
updates and uses connection parameter request in slave role
to negotiate non-overlapping placement with active master
roles to avoid slave roles drifting into active master
roles in the local controller.

This feature maximizes the average data transmission amongst
active concurrent master and slave connections while other
observer, initiator, master or slave roles are active in the
local controller.

Disabling this feature will lead to overlapping role in
timespace leading to skipped events amongst active roles.

Change-id: I16e4e6c3ca99f93987ab86924af0cb9d76bdbc7e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Vinayak Chettimada 646726518f Bluetooth: controller: Kconfig for advanced event preparation
Added Kconfig option to enable advanced event preparation
feature.

Enables advanced event preparation offset ahead of radio
tx/rx, taking into account predictive processing time
requirements in preparation to the event, like control
procedure handling and CPU execution speeds. Crystal
oscillator is retained between closely spaced consecutive
radio events to reduce the overall number of crystal
settling current consumptions.

This feature maximizes radio utilization in an average role
event timeslice when they are closely spaced by using a
reduced offset between preparation and radio event.

By disabling this feature, the controller will use a
constant offset between the preparation and radio event. The
controller will toggle crystal oscillator between two
closely spaced radio events leading to higher average
current due to increased number of crystal settling current
consumptions.

Change-id: I19e640f7395ac7938873ef4bfac38acf8d6f7e0e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-08 20:11:54 +03:00
Mariusz Skamra ea8ca7d400 Bluetooth: tester: Fix UART issue on qemu
This fixes an issue introduced by bab3aafa2d,
which changed the default value of UART_PIPE_ON_DEV_NAME to the same
used by BLUETOOTH_UART_ON_DEV_NAME. Due to this, the BTP and HCI were using
the same UART.

Change-Id: Ib59819e49610f28f4c89c0304d024bb1b6aa506a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2017-03-24 10:16:08 +01:00
Vinayak Chettimada 2037ec803d Bluetooth: shell: Add connection update command
Added conn-update command to btshell module to test
bt_conn_le_param_update Bluetooth API.

Change-id: I205df9ffc12a0ab062de5a779ab96bc91cbd9259
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:43 -07:00
Vinayak Chettimada 30a46529b2 Bluetooth: shell: Reorder commands in logical order of use
Reordered the commands in btshell to represent the logical
order of use. Moved advertise and scan before connect
command.

Change-id: Id64509e39848109a6df7ddb1306b6bd221b65c40
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:42 -07:00
Johan Hedberg e085ff49b9 Bluetooth: shell: Add command to start continuous passive scanning
Change-Id: I0d9c2f47014464a27ff24ac79a16ee956bbcf62c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Johan Hedberg 1ce1c3484e Bluetooth: shell: Fix missing initialization of param.own_addr
Add proper logging for errors in the same go.

Change-Id: I8bd4fa8d5b143e51024496bfba0056525ad35964
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Johan Hedberg 5517893543 Bluetooth: Make bt_hci_driver instances link-time constants
Declaring these as const lets the linker generate more optimal code.
Some extra care is needed with hci_ecc.c since it was overwriting the
send callback. Now the choice of send() call is done directly in the
bt_send() function

Change-Id: Iac74f5ee9bee097bbb34c11bd13d1d886700f5cc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-21 17:05:42 -07:00
Vinayak Chettimada 0d75faf02d Bluetooth: Controller: Add advertisement event indication feature
Add a Controller event that indicates everytime
advertisement event has been transmitted on air.

Change-id: I4722488bbfeca987e66983faf5b26467407a89c9
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-21 17:05:42 -07:00
Kaustav Dey Biswas c25df73c5a Bluetooth: SDP: Server: Refactor data element structure header
Separate out data element structure header into type and size fields

Change-Id: I869ee1ea82db1f6d669bb905055135b7d63f3fa2
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
2017-03-07 12:21:29 +01:00
Szymon Janc dc2ce98088 Bluetooth: shell: Fix GATT long write support
Parameters and data must be permament for time of the operation.

Change-Id: Idd4eee948e62c2c80648116a339558042059f801
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 10ce50dc30 Bluetooth: shell: Simplify indication in gatt-subscribe
Instead of passing exact value allow to use 'ind' for enabling
indications instead of notifications.

Change-Id: I24306a321ed90b4bcb6300846218ff7214b39bc4
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 667e3af3dd Bluetooth: shell: Don't echo LE CoC data
Don't echo data from received callback as this can cause
deadlock. Just dump incoming data instead.

Change-Id: Iedbbafd0406ad46ba2c9d26fd8a70fff59de8143
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc 691397023b Bluetooth: shell: Fix typo
Change-Id: I2c1a6e7cb61f65ce2292f128e73dc2d80372f773
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Szymon Janc af7d0c64a8 Bluetooth: shell: Fix accessing invalid memory
argc needs to be check before accessing argv.

Change-Id: I9cb70906a388b96df4e192dd4f31eafdab25127f
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-03-07 12:21:29 +01:00
Arkadiusz Lichwa 9fff70dbe5 Bluetooth: shell: Add support to retrieve A2SRC record
Adds to BT shell app functionality to trigger to be found on remote
A2SRC UUID. Implements user callback to read resolved response data
and uses existing SDP client API to read attributes values.

> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 48
      Channel: 64 len 44 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Response (0x07) tid 2 len 39
        Attribute bytes: 36
        Continuation state: 0
        Combined attribute bytes: 89
          Attribute list: [len 84] {position 0}
            Attribute: Service Record Handle (0x0000) [len 2]
              0x00010005
            Attribute: Service Class ID List (0x0001) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Audio Source (0x110a)
            Attribute: Protocol Descriptor List (0x0004) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  L2CAP (0x0100)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0019
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  AVDTP (0x0019)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0102
            Attribute: Browse Group List (0x0005) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Public Browse Root (0x1002)
            Attribute: Bluetooth Profile Descriptor List (0x0009) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  Advanced Audio Distribution (0x110d)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0102
            Attribute: Unknown (0x0100) [len 2]
              Advanced Audio [len 15]
            Attribute: Unknown (0x0311) [len 2]
              0x0001
< ACL Data TX: Handle 77 flags 0x00 dlen 12
      L2CAP: Disconnection Request (0x06) ident 10 len 4
        Destination CID: 65

Change-Id: I8938d9eebda31f3d252ff49adc1a96abfcbc5751
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 658ea8cc4b Bluetooth: shell: Use SupportedFeature attribute API
BT shell app tries to retrieve supported features exposed by remote
HFPAG enabled SDP record.

Jira: ZEP-1112

Change-Id: Ic8e5e8bd7cdea822fcaea317e884233e3bf0b4f9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 4f8641990c Bluetooth: shell: Add getting ProfileDescriptorList attribute
Makes use ProfileDescriptorList atribute API to get remote Hands-Free
profile version.

Jira: ZEP-1112

Change-Id: I3752691057e15c3a9a681dd3277ac160096792e9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Arkadiusz Lichwa 7577a4ff7c Bluetooth: shell: Add SDP client support
Adds pool memory for storing SDP client query results and introduces
command allowing add HFPAG UUID to be resolved when connection to peer
is already set. When resolved data arrives, UUID callback handler
tries to identify RFCOMM protocol specific information, in this case
remote HFPAG Server Channel Number, stored in Protocol's Descriptor List
attribute data.

> HCI Event: Number of Completed Packets (0x13) plen
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 55
      Channel: 64 len 51 [PSM 1 mode 0] {chan 0}
      SDP: Service Search Attribute Response (0x07) tid 2 len 46
        Attribute bytes: 43
        Continuation state: 0
        Combined attribute bytes: 96
          Attribute list: [len 91] {position 0}
            Attribute: Service Record Handle (0x0000) [len 2]
              0x00010003
            Attribute: Service Class ID List (0x0001) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Handsfree Audio Gateway (0x111f)
              UUID (3) with 2 bytes [0 extra bits] len 3
                Generic Audio (0x1203)
            Attribute: Protocol Descriptor List (0x0004) [len 2]
              Sequence (6) with 3 bytes [8 extra bits] len 5
                UUID (3) with 2 bytes [0 extra bits] len 3
                  L2CAP (0x0100)
              Sequence (6) with 5 bytes [8 extra bits] len 7
                UUID (3) with 2 bytes [0 extra bits] len 3
                  RFCOMM (0x0003)
                Unsigned Integer (1) with 1 byte [0 extra bits] len 2
                  0x03
            Attribute: Browse Group List (0x0005) [len 2]
              UUID (3) with 2 bytes [0 extra bits] len 3
                Public Browse Root (0x1002)
            Attribute: Bluetooth Profile Descriptor List (0x0009) [len 2]
              Sequence (6) with 6 bytes [8 extra bits] len 8
                UUID (3) with 2 bytes [0 extra bits] len 3
                  Handsfree (0x111e)
                Unsigned Integer (1) with 2 bytes [0 extra bits] len 3
                  0x0106
            Attribute: Unknown (0x0100) [len 2]
              Handsfree Gateway [len 18]
            Attribute: Unknown (0x0301) [len 2]
              0x01
            Attribute: Unknown (0x0311) [len 2]
              0x0027
< ACL Data TX: Handle 77 flags 0x00 dlen 12
      L2CAP: Disconnection Request (0x06) ident 5 len 4
        Destination CID: 64
        Source CID: 64
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 77
        Count: 1
> ACL Data RX: Handle 77 flags 0x02 dlen 12
      L2CAP: Disconnection Response (0x07) ident 5 len 4
        Destination CID: 64
        Source CID: 64

Jira: ZEP-1112

Change-Id: Ibda606fabe367ca3d0353f77c7093da8c4f175c8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-02-05 22:39:25 +02:00
Johan Hedberg eb07178236 Bluetooth: samples: Use Kconfig DEVICE_NAME variable when possible
Instead of using a hard-coded string, make the sample use the Kconfig
variable for the device name.

Change-Id: Ib09f594e1cba221f9064318572bd90d38bd2733a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
Johan Hedberg 4153b6ca1f Bluetooth: Kconfig: Make device name variable generic
Change BREDR_NAME to DEVICE_NAME so it can also be used as the LE
device name.

Change-Id: I9ef55d9dff098372d47d9d5754ad7a7163a65bc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Johan Hedberg 767c92e176 Bluetooth: Consolidate most outgoing ACL TX buffers into a single pool
Having TX buffers split into numerous pools has the downside of
increased memory consumption. This patch takes the initial step to
consolidate these pools into a single one, saving about 248 bytes of
RAM for a basic configuration.

Change-Id: I449ba18b44a9a6af68e9a2c44f19a9286eb88b14
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-17 08:44:21 +02:00
Anas Nashif 2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Kumar Gala 0314a4e287 Bluetooth: remove arduino_101_ble from test_controller_dbg
RAM size has increased on arduino_101_ble which causes it to no longer
be able to build test_controller_dbg.

Change-Id: Iab8ed2857db23d048cfa6b04e2d1fea31efbb13c
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-09 20:56:11 +00:00
Jithu Joseph 89f4bf7c7e subsys: disk: Refactor disk_access stuff into a directory
Disk IO functions are used by both FS and USB Mass Storage.
This patch refactors those from FS directory to a separate one.
In addition existing, config options were modified to make
stuff meaningful.

Jira: ZEP-1276

Change-Id: Ia2a2e18f3dbbbdb964c3dc0427d8138ad86134cd
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-01-08 20:58:05 +00:00
Vinayak Chettimada 27353bb655 Bluetooth: Controller: Kconfig connection RSSI measurement
Add Kconfig configuration and conditional compilation of
RSSI measurement during a connection.

Change-id: I5a2f23f76a7cbbd9569d53d31899a472bf39d3ee
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada 08fcc44b8a Bluetooth: Controller: Kconfig Data Length Update feature
Add Kconfig configuration to conditionally enable Data
Length Update procedure support in the Controller.
This will save CPU time, flash and RAM, if this feature is
not desired.

Change-id: I4515c0c7cf9aeb333a289397ae3c9bac04a08e4e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada b37e285c03 Bluetooth: Controller: Kconfig LE Ping feature
Add Kconfig configuration to conditionally enable LE Ping
feature in the Controller.
This will save CPU time, flash and RAM, if this feature is
not desired.

Change-id: I5fbbdbe8f45ac01c9b0d7b11e002a0d1db4d272e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada 04794ba1c1 Bluetooth: Controller: add init test for BT 4.0 only controller
Add a test configuration to build a controller that
supports only Bluetooth v4.0 features.

This is copy of prj_controller.conf, but Kconfig defines
will be added in subsequent commits to conditionally
compile out feature not in Bluetooth v4.0 specification.

Also, added nrf52840_pca10056 and arduino_101_ble board
builds be tested.

Change-id: I36891bfc54cc36a8588c9b019de582e3193e8aa3
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Vinayak Chettimada a591205045 Bluetooth: Controller: Kconfig radio ISR profiling
Add Kconfig configuration and conditional compilation of
radio ISR profiling.

Change-id: Ia80d6bc54810156be99b2e6a25327c30d0714697
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Johan Hedberg 63f71adc5f Bluetooth: Take advantage of new net_buf_add_mem() API
This helps simplify code that was previously combining net_buf_add()
with memcpy().

Change-Id: If44cf9cd651aba5e544e36567869f147468663eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:16 +02:00
Anas Nashif 66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif 7297f5db88 shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.

Additionally, one Kconfig option will now be required to enable the
shell:

 CONFIG_CONSOLE_SHELL=y

The header files was also moved to include/shell/shell.h and can be now
referenced with

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 19:35:11 +00:00
Szymon Janc ad8eee2788 Bluetooth: shell: Fix br-discovery help message
Timeout should be passed as decimal.

Change-Id: I9f772b918e33eded8e0328e655e83cca74166595
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-24 08:42:15 +02:00
Szymon Janc 17ea315e20 Bluetooth: shell: Add option to specify BR/EDR discovery length
This allows to specify length of discovery from command line.

Change-Id: I3ad80e74b5cdc263e549ce309b75c1f5c117b653
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-24 08:42:15 +02:00
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00
Johan Hedberg 1c9da665c3 Bluetooth: Remove unnecessary runtime kernel object initialization
There are static initializer macros available for most kernel objects
which we should use whenever possible.

Change-Id: I496f4d05d26801eddd21fae53bdd4fcdc3246fe3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-16 10:27:48 +02:00
Anas Nashif fe958df4dd libc: rework libc selection and reduce Kconfigs
Moved all libc Kconfigs to where the code is and remove the default
Kconfig for selecting the minimal libc. Minimal libc is now the default
if nothing else is configured in.

Removed the options for extended libc, this obviously was restricting
features in the minimal libc without a good reason, most of the
functions are available directly when using newlib, so there is no
reason why we need to restrict those in minimal libc.

Jira: ZEP-1440
Change-Id: If0a3adf4314e2ebdf0e139dee3eb4f47ce07aa89
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 22:31:28 +00:00
Johan Hedberg 71c7c01819 net: buf: Remove the need for net_buf_pool_init()
In order to keep the initialization process light-weight, remove
net_buf_pool_init() and instead perform the initialization of the pool
and buffers in a "lazy" manner. This means storing more information
in the pool, and removing any 'const' members from net_buf. Since
there are no more const members in net_buf the buffer array can be
declared with __noinit, which further reduces initialization overhead.

Change-Id: Ia126af101c2727c130651b697dcba99d159a1c76
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-15 09:58:02 +02:00
Marcus Shawcroft fe8d044d9a tests: Remove unnecessary CONFIG_TEST_RANDOM_GENERATOR
Remove CONFIG_TEST_RANDOM_GENERATOR from each test and sample where it
is not required.

Change-Id: I949f8e93c2cb1881622a5e48efeb87c43122a170
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Johan Hedberg c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
Jaganath Kanakkassery 77753193d9 Bluetooth: shell: Add support for RFCOMM Disconnect
This is used to disconnect a dlc.

Syntax:
>br-rfcomm-disconnect

Change-Id: I8f345d9fbb1f1f84bfb1f697322d9a87ff531797
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-12-09 06:53:14 +00:00
Johan Hedberg a4b6b2417d Bluetooth: Switch from printf to printk functions
There's now snprintk available that's more light-weight on the stack
than snprintf.

Change-Id: I6b3e4409703ca92fe6b8f4146ff47c490ab826cb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-09 08:18:24 +02:00
Szymon Janc cb67b35c5a Bluetooth: tests: Fix Makefiles comments
Those tests are now build with unified kernel.

Change-Id: Idbc42bb77060cea0130d62cccdf2e40aeee89128
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Johan Hedberg 1e20e8dc04 Bluetooth: Fix left-over usage of TICKS_NONE and TICKS_UNLIMITED
Switch left-over usage of TICKS_NONE and TICKS_UNLIMITED to the new
unified kernel counterparts K_NO_WAIT and K_FOREVER.

Change-Id: I2f2a16360e816f9f8791eb216deb3c70b8cc87df
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-12 19:27:34 +02:00
Johan Hedberg 63a8f3b824 Bluetooth: tests/tester: Convert left-overs to unified kernel APIs
Convert fiber_start to k_thread_spawn and nano_fiber_fifo_put to
k_fifo_put.

Change-Id: If1ec405ec602e28a538f4c9569ede87519346559
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 11:00:45 +02:00
Szymon Janc 2b16287286 Bluetooth: Use proper timeout defines for net_buf_get_timeout
Use defines from k_fifo intead of legacy API.

Change-Id: Ib8cf0d88240ef145da550b8cf83d2580e7140521
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 06:00:28 +00:00
Szymon Janc 051f97bd7a Bluetooth: samples: Fix use of deprecated sleep API
Use new sleep API or remove sleeps where not needed.

Change-Id: I88c0973e57eb4970b68b3f4fa428683191b1a7f0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Szymon Janc 47eaaf9f96 Bluetooth: Use unified k_fifo API for FIFOs
Change-Id: I6ddc24575e4bf3c3040945a2bdb62f153b15cdb3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Jaganath Kanakkassery f2b1ffbedb Bluetooth: shell: Add support for RFCOMM Connect
This can be used to initiate an outgoing connection
Syntax:
>br-rfcomm-connect <channel>

Change-Id: I7ac7aeb61e7ae7e3f55c7cd7e815bdb604b27fb3
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg c583a9f43b Bluetooth: Kconfig: Restructure for a more logical hierarchy
Restructure the Bluetooth options more logically.

- Both host and controller are now behind the same high level
  CONFIG_BLUETOOTH.

- Selecting controller support disables other HCI driver selection, so
  the controller isn't in the same list as HCI drivers any more.

- Under the top-level there's a "Custom stack" option, which when
  enabled opens up the option of choosing CONFIG_NBLE.

There are various other cleanups and simplifications in this patch as
well, since splitting these up would have been fairly tricky while
making sure all test cases still build.

Change-Id: I5bb715cb9d20201cb8b72fbd149c8a09a4b2d7d2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg 77dcd7151d Bluetooth: tests/shell: Add Arduino 101-specific configuration
Add an Arduino 101-specific configuration that enables flash-based
storage support as well as the file system shell.

Change-Id: Ic10ea958dd2446df4942a8dfd3cce1e3368852b2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 09:15:46 +00:00
Johan Hedberg 7e1234b44b Bluetooth: tests/shell: Implement "clear" command
Implement a new "clear" command to exercise the bt_storage API. The
command can either take an address parameter to clear storage for a
specific device, or, if called with the parameter "all", to clear the
entire storage.

Jira: ZEP-181

Change-Id: I1ebd17033f2062951abeeb7d7c448a34a3672577
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Mariusz Skamra 0c8ea2037e Bluetooth: tester: Enable privacy for QEMU configuration
Change-Id: I9030f94bb42bfc0aa3e39dac52570eae1d2121a0
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:31 +02:00
Mariusz Skamra d1b8d25068 Bluetooth: tester: Increase number of available L2CAP channels
This increases number of available L2CAP channels for the test purposes.
This is needed for TC_COS_CFC_BV_05_C test case.

Change-Id: I5df099fb64632e1a0e557852ca55ee45a9cc89ed
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:31 +02:00
Mariusz Skamra 3b27f9857d Bluetooth: tester: Fix configuration file name
This fixes configuration file name in testcase.ini file.

Change-Id: I6496f98694415bfc3a76308aa9ee6dfd008e1691
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:31 +02:00
Mariusz Skamra 00f4f2f66c Bluetooth: tester: Set Zephyr-based BLE configuration as default
This updates README as well as makefile to choose Zephyr BLE firmware
configuration as a default one.

Closes: ZEP-1187

Change-Id: I78dec2a4e2b5bfe634a8b7b8897d4f6ab6b37b44
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:31 +02:00
Mariusz Skamra 8f2ffb6a45 Bluetooth: tester: Add configuration file for Zephyr BLE firmware
This adds sample configuration file for tester application that
supports controllers with Zephyr-based BLE firmware.

Change-Id: I8b63f93d1395837b8485aba7060b6626be1daab1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:07 +02:00
Mariusz Skamra 79b5e7e6fa Bluetooth: tester: Rename config files
This removes redundant prj_* prefix from configuration file name.

Change-Id: I9867fa345791e68b64f83bb0cd75634cf1cde887
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-04 22:06:07 +02:00
Johan Hedberg ac844cf687 Bluetooth: Remove misleading NBLE mentions from sample README files
The README files provided with the samples contain references to NBLE,
which is not a publicly supported solution for Bluetooth. Simply
remove these files. If the need arises to provide application-specific
information in the future we can add back per-application README
files.

Jira: ZEP-1183

Change-Id: I81b3ea5491d50fb16062ccd5a421ddc8fcb7ea42
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-04 22:05:05 +02:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Yael Avramovich d5db35204a console: shell: Support multiple modules
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.

Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.

Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 00:23:18 +00:00
Luiz Augusto von Dentz 2538811fa9 Bluetooth: shell: Add support for setting security level to l2cap_register
This adds support for setting the minimun required security level to
l2cap_register command:

l2cap-register <psm> [sec_level]

Note that entering the security level is optional and the default is
BT_SECURITY_LOW(1).

Change-Id: Ib6dea92919357f41fe2f4de3050b9a10a7f553d6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg 079030718f Bluetooth: Move hci_driver.h to include/drivers/bluetooth
This header file is not intended for applications, rather than for
drivers, so move it to the appropriate place.

Change-Id: I7ff8158418e7e839b538c6cccbb32f3af43c12c6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg 900fbc20ba boards: x86: Don't default to 'y' with NRF51_PM and WAIT_NOP
These options were only needed for a MyNewt-based nRF51 firmware on
these boards (the MyNewt BLE stack is called Nimble, hence the
prj_nimble.conf sample config files). With a Zephyr-based nRF51
firmware these options are no-longer needed, so it's not appropriate
to have them default to enabled. Instead, if they are needed, require
the app-specific configuration to enable them.

Change-Id: Iefbee4d97590af4e11bcedea05fe61f32a147b83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 19:37:26 +00:00
Anas Nashif 6043c30aa4 tests: samples: exclude quark_d2000_crb from large applications/tests
Change-Id: I108639966d5bb66fb08d745155d692b82c304de1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 16:10:45 -04:00
Johan Hedberg 6c54c92e84 Bluetooth: tests/init: Limit controller+host for 32kB RAM platforms
The combined controller & host build takes up too much RAM for the
16kB arduino_101_ble target, so limit it to the 32kB nRF52 & nRF51
DevKits.

Change-Id: Ib9d04765697b7f5c748633cb6244474d92f96995
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 19:27:39 +00:00
Szymon Janc fb5424392b Bluetooth: Use unified kernel build for tests and samples
This makes all Bluetooth samples and tests being build with unified
kernel. main() is now executed from init thread and specifying task
for it in mdef file is no longer needed. By default main stack is
1024 bytes and this should be enough for BT samples.

Change-Id: I6674eea2c028b78ada5190acef72937186738af2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-28 08:30:57 +02:00
Johan Hedberg 6989bf88e1 Bluetooth: Rename bt_driver to bt_hci_driver
The bt_driver API was created when Zephyr only had a Bluetooth host
stack, but no controller-side functionality. The only "driver" that
was needed for the host was the HCI driver, and hence "HCI" was
omitted from the name.

With support both for host and controller Zephyr will be getting more
Bluetooth driver types, in particular radio drivers. To prepare for
this, move all HCI drivers to drivers/bluetooth/hci/ and rename the
bt_driver API bt_hci_driver.

Change-Id: I82829da80aa61f26c2bb2005380f1e88d069ac7d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00
Johan Hedberg 19138eb2f4 Bluetooth: samples: Remove redundant CONFIG_ARC_INIT=n
CONFIG_ARC_INIT defaults to 'n' now days so there's no reason to try
to explicitly disable it in the sample config files.

Change-Id: I88df06ba23bdac697f0767384f7b88e3bd9fced9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00