Commit graph

919 commits

Author SHA1 Message Date
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Joao Cordeiro 74f01067e7 samples: bluetooth: peripheral: Fix RX buffer size
GATT long messages require buffers to store multiple packets. The actual
configuration for the bluetooth peripheral sample defines only two
buffers to store these messages. As the default ATT payload size is
18 bytes, the maximum payload size for a long ATT message is 36 bytes.
As the variable `vnd_long_value[]` has a defined size of 74 bytes, it
cannot be fully modified due to the 36 bytes limitation.

Set CONFIG_BT_ATT_PREPARE_COUNT=5 so all the maximum payload size goes
to 90 bytes and all the 74 bytes can be written to `vnd_long_value[]`.

Signed-off-by: Joao Cordeiro <jvcc@cesar.org.br>
2019-05-21 16:15:44 -04:00
Marcin Szymczyk e5cbe6a9e7 usb: cdc: Add unique PIDs for each sample
Unique PID is required for each sample in order
to be recognized by host.

When creating a new sample:
- Add USB_PID_<SAMPLE_NAME>_SAMPLE
  in samples/subsys/usb/usb_pid.Kconfig
- Create Kconfig file in your sample's subdirectory, containing:
  config USB_DEVICE_PID
	default USB_PID_<SAMPLE_NAME>_SAMPLE

  source "Kconfig.zephyr"

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04:00
Peter Herager 95e1eb960b Bluetooth: Add additional attributes to DIS
Add SW, HW, FW & serial attributes to DIS
Add support for reading attributes from settings during boot

Signed-off-by: Peter Herager <pehe@oticon.com>
2019-05-08 20:17:07 +03:00
Aaron Tsui 631cd007bd samples: bluetooth: ibeacon: change to ADV_NONCONN_IND type
According to the Apple iBeacon spec chapter "2.1 Advertising Packet",
"beacons must use a non connectable undirected Advertising PDU,
ADV_NONCONN_IND". Refer to https://developer.apple.com/ibeacon/

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-03 14:27:34 +03:00
Luiz Augusto von Dentz c42707c2d3 Bluetooth: Use BT_GATT_SERVICE_DEFINE whenever possible
This makes use of BT_GATT_SERVICE_DEFINE to statically define services
for services that are not required to be dynamically registered.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-02 08:29:23 +03:00
Emanuele Di Santo 43b00eff1f samples: bluetooth: hci_uart: update nrf52840_pca10090 config
Enable the GPIO reset pin feature of nrf52840_pca10090
on pin P1.02 and the wait NOP feature of the controller.
These are used to let nrf9160_pca10090 synchronize the
HCI communication with nrf52840_pca10090 controllers.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-04-19 12:21:21 +02:00
Carles Cufi 14c75705cb samples: hci_uart: Reduce MAX_CONN to 16 for the micro:bit
In order to fit in SRAM, reduce the CONFIG_BT_MAX_CONN from 20 to 16 in
the configuration used for the BBC micro:bit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
Carles Cufi bae9f1967b samples: Bluetooth: hci_uart: Implement NOP Command Complete
Implement the Controller counterpart to CONFIG_BT_WAIT_NOP so that it
issues a NOP Command Complete event after booting up, to signal to the
Host that it is ready to receive HCI traffic.

Fixes #15333

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif 6e6f13c18a samples: fix identifiers for samples
Fix identifiers for tests in samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-01 12:23:09 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Luiz Augusto von Dentz 58baad7c5e Bluetooth: ipsp: Fix not checking return of build_reply
net_pkt_sendto uses size_t as parameter for len so the value would be
treat as unsigned which may cause and invalid memory to be read.

Fixes #14950 #14955

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-29 10:39:53 +01:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Luiz Augusto von Dentz ef9c7a4b5d Bluetooth: samples: IPSP: Fix not checking return of net_pkt_read
net_pkt_read may fail in which case the error shall be reported back
instead of always assuming the whole packet was read.

Fixes #14817

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-22 12:13:42 +02:00
Tomasz Bursztyka 03bfc5dd0f net/context: Remove token parameter from net_context_send/sendto
And also to the relevant callbacks.

That parameter is not used anywhere so it is useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka a25f054cbd net/pkt: Remove _new suffix to net_pkt_read functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka 172fe5a87b net/context: Remove _new suffix on net_context_send/sendto functions
Now that legacy functions are removew, let's rename the new functions by
removing the _new suffix.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Johan Hedberg 8c294995e0 samples: bluetooth/mesh: Fix configuration
This sample is often the first one used as reference for Bluetooth
Mesh, so it should have a good configuration as a starting point.
Comment out the LPN options to eliminate Kconfig warnings, since the
LOW_POWER option they depend on is not enabled. Also disable
INIT_STACKS since that's only needed for fine-tuning the app
configuration, and otherwise only causes unnecessary spam in the
console.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-19 15:24:09 +02:00
Johan Hedberg dffe78b332 samples: bluetooth/mesh_demo: Fix using internal API
Use K_SEM_DEFINE() instead of the internal _K_SEM_INITIALIZER() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-15 20:40:51 +01:00
Tomasz Bursztyka 078be776ee samples/bluetooth: Switch ipsp sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Carles Cufi 8f05a4c6d5 doc: Bluetooth: Documentation overhaul
Overhaul the Bluetooth documentation to split it into manageable units
and include additional information, such as architecture and tooling.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-13 10:40:05 +01:00
Thomas Stenersen 7516476386 kconfig: Use depend on instead of select to avoid kconfig loop
Remove use of select to "force" enabling other configs in subsys/fs
and subsys/net/l2. The forcing will cause infinite kconfig recursion.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
David B. Kinder 505cc2bb0e doc: use :zephyr_file: where appropriate
A new role :zephyr_file: is available that renders to a link to the file
or folder in GitHub.  Find appropriate references using :file: and
convert to :zephyr_file: to take advantage of its linking capability.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-09 09:50:27 -05:00
Carlos Stuart 75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Erwan Gouriou 1227b2feda samples/bluetooth: Add note about Long term key clearance
It could happen that bluetooth samples fail because of stored LTK
on device used to test the sample (eg smartphone).

Add a note in bluetooth sample doc to inform users of this trick.

Fixes #13034

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-13 19:51:39 +02:00
Andrzej Głąbek 9856554751 samples: bluetooth: Fix hci_spi sample
This commit fixes the following issues introduced when switching to
the new SPI API in commit e7de85b5343f2ed118a5c4a043ab7bbae9eec608:
- the SPI slave operating mode (and support for it) was not properly
  selected (the setting was missing in the sample probably because
  the old nRF SPI slave driver used in this sample was not checking
  the requested mode at all)
- the `txmsg` buffer filled with 0xFF values in the `bt_tx_thread`
  function was improperly used afterwards in `spi_send` to transmit
  the slave header frame
- the common structures defining buffers for SPI transactions (`tx`
  and `rx`) were modified in `spi_send` before the corresponding
  semaphore was taken, resulting in data corruption

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-01 19:12:57 -05:00
Andrzej Głąbek 1dbcd0affa samples: bluetooth: hci_spi: Use DT instead of Kconfig to get HW params
Convert the hci_spi sample to get the SPI and GPIO settings from Device
Tree instead of Kconfig.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-01 19:12:57 -05:00
Tomasz Bursztyka 4b78a251d7 net/context: Make recv_cb providing the ip and protocol headers
If status is 0, both ip_hdr and proto_hdr will own a pointer to the
relevant IP and Protocol headers. In order to know which of ipv4/ipv6
and udp/tcp one will need to use respectively net_pkt_family(pkt) and
net_context_get_ip_proto(context).

Having access to those headers directly, many callbacks will not need
to parse the packet again no get the src/dst addresses or the src/dst
ports. This will be change after this commit.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Emanuele Di Santo 3110937556 samples: bluetooth: hci_uart: add configuration for nrf52840_pca10090
Add a project configuration for nrf52840_pca10090 that will
route the nRF9160 interface pins to the nRF52840, and use them
for HCI over UART.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-25 22:26:17 +01:00
Kumar Gala 5828dda6d4 samples: bluetooth: peripheral_hr: Rework FRDM-KW41Z shield support
Split out the boards that utilize the FRDM-KW41Z as a seperate test
where we explicitly set the shield as an extra_args instead of having to
do it in the CMakeLists.txt file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-19 07:16:40 -05:00
Erwan Gouriou 0115c47b69 cmake: dts: move to specifying shield on the command line
Rather than specifying SHIELD via Kconfig, we move it to being
specified via the command line, similar to board.

So we can do:

  -DSHIELD=x_nucleo_iks01a1

or, for multiple shields:

  -DSHIELD="x_nucleo_iks01a1 frdm_kw41z"

Following cmake change, update x_nucleo_iks01a1 sample in order
not to enable CONFIG option anymore but set SHIELD cmake option.

Last, update documentation to reflect this change.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 13:20:59 -06:00
Johann Fischer 2dbac49cd6 samples: ipsp: clarify how to build for kernels before 4.12
Clarify how to build for Linux kernels released before 4.12.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-16 21:42:48 -05:00
Johann Fischer 4f81113631 samples: ipsp: remove undefined symbol NET_DEBUG_L2_BT
Remove undefined symbol NET_DEBUG_L2_BT

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-16 21:42:48 -05:00
Maureen Helm f22bd777d6 samples: bluetooth: Build peripheral_hr sample on more imx rt boards
Adds mimxrt1020_evk and mimxrt1060_evk to the list of boards for the
peripheral_hr sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-16 12:32:16 -06:00
Luiz Augusto von Dentz 330cbfa074 Bluetooth: peripheral: Fix check of BT_GATT_WRITE_FLAG_CMD
Check should be done with & instead of | otherwise it will always be
evaluated as 1/true regardless of the flags.

Fixes #12308

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-04 21:13:06 +01:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Carles Cufi b51b7becf4 doc: samples: Update samples to point to active boards
Since the Arduino 101 and the Quark SE C1000 are not actively developed
boards, default to other boards that are maintained and used.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-12 23:06:16 +01:00
Patrik Flykt 079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Mariusz Skamra 8f5ba0be88 Bluetooth: Add common Kconfig option to disable LE Data Length Update
This adds common option to disable support for LE Data Length Update
procedure in controller and host.
This will reduce flash usage by compiling out le_data_len_change
event handler that will never be called if controller has been
compiled with BT_CTLR_DATA_LENGTH option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Mariusz Skamra be314d3af5 Bluetooth: Add common Kconfig option to disable PHY Update
This adds common option to disable support for PHY Update
procedure in controller and host.
This will reduce flash usage by compiling out le_phy_update_complete
event handler that will never be called if controller has been
compiled with BT_CTLR_PHY option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Luiz Augusto von Dentz 92fba52168 Bluetooth: samples: peripheral: Add write command characteristic
This adds a characteristic that only allows write command.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-21 12:54:17 +01:00
Kumar Gala a0b660730f samples: Add explicit zephyr_include_directories to get <board.h>
There are a small handful of samples that still utilize <board.h>
include, to minimize the use of <board.h> to these specific cases and
allow us to remove adding the board dir to the top level include search
path, we explicitly in each sample add the specific board dir it needs.

For the microbit cases these could be replaced by DTS support in the
future when the pwm_nrf5_sw supports DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 09:14:07 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Krzysztof Chruscinski 97345dbb1b logging: Fix errors in log usage
Couple of findings which were revealed after changing
LOG_MODULE_REGISTER macro:
- missing semicolons after LOG_MODULE_REGISTER()
- missing LOG_LEVEL defines
- other

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Emanuele Di Santo 7e8b44f774 subsys: bluetooth: services: dev. information service enhancements
This commit moves the BLE GATT Device Information service
from /samples/bluetooth/gatt to /subsys/bluetooth/services and adds
a Kconfig entry to enable and configure the service;
when enabled, it will register itself automatically.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-07 18:08:05 +01:00
Kumar Gala a8f1431a53 boards: bbc_microbit: Move button data into dts from board.h
Move the GPIO info for the buttons into the dts, this lets us match what
all other boards are doing.  Update some sample & test code to use the
dts generated SW0_GPIO_CONTROLLER define instead of SW0_GPIO_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 15:58:51 -05:00
Maureen Helm 91381b60c9 samples: bluetooth: Add a configuration using the kw41z shield
Adds a new configuration to the peripheral_hr sample that utilizes the
frdm_kw41z as a ble controller shield.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-11-01 07:22:10 -04:00
Henrik Brix Andersen 8d56730b00 samples: hci_uart: add note about reduced baudrate on the BBC micro:bit
The BBC micro:bit uses a baudrate of 115200 for the hci_uart
sample. Add a note about this to avoid any confusion.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-10-28 07:29:05 +00:00
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 f98f4e243a samples: ipsp: 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 6bb5a3536a samples: hci_uart: 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 e52c20c13c samples: hci_spi: 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 251d99132d Bluetooth: Remove custom stack macros
Now that log processing happens in a separate thread, the
BT_STACK_EXTRA macro is not needed (since there's no significant
overhead), and therefore the BT_STACK macros become unnecessary as
well.

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
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Joakim Andersson 773b21ac38 bluetooth: config: Fix bluetooth config dependencies
Fix bluetooth config dependencies where the definitions depend on other
definitions.
BT_RX_PRIO is not always defined in a controller only build.
BT_CTLR_TX_BUFFER_SIZE does not depend on BT_CTLR, but BT_LL_SW.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-10-05 11:15:27 -04:00
Johan Hedberg cf6f87f25b Bluetooth: samples/peripheral_sc_only: Improve logging
The periphreal_sc_only sample app wasn't very clearly logging
information about pairing failures and could give the false
impression that everything work when it doesn't. Enable some more
logging Kconfig features and take advantage of the pairing complete &
failed callbacks to give more information to the user.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-24 10:48:40 +03: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
Luiz Augusto von Dentz 4e208b24bd Bluetooth: IPSP: Fix pointing to invalid file
sample/net/README no longer exists so this removes its mention since
it is already described how to use echo-client at the end of the
document. Also state that CONFIG_BT_6LOWPAN shall be set in order to
use Bluetooth 6LoWPAN module with Linux.

Fixes #9727

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-08-30 09:25:30 -04:00
Radoslaw Koppel 0d0b221efa samples: bluetooth: peripheral_hids: Add settings module
This commit adds settings module to the peripheral_hids that makes
bonding persistent.
Now it is possible to connect with previously bonded device.

Fixes #9580

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-08-23 15:29:46 +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
Paul Sokolovsky 028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07: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 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 a8688fc587 Bluetooth: peripheral: Set CONFIG_BT_DEVICE_NAME_MAX
This force CONFIG_BT_DEVICE_NAME_MAX to be set even in boards where
CONFIG_BT_SETTINGS won't be defined so it exercise such configuration.

In addition to that set a long name that would not fix in the
ScanData.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Luiz Augusto von Dentz 2e2f122d51 Bluetooth: samples: Make use of BT_LE_ADV_OPT_USE_NAME
Use BT_LE_ADV_OPT_USE_NAME whenver possible since it does properly
track updates.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Anas Nashif 4208642a53 samples: 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
Kumar Gala 8b8198b58f samples: mesh_demo: Fix Fix warning when building with newlib
If we use newlib the isdigit (and other similar functions) return an
error as char can possibly be viewed as signed:

usr/include/ctype.h:57:54: error: array subscript has type ‘char’ [-Werror=char-subscripts]
 #define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])

Explicity cast to unsigned char so we deal with both this warning and
possible warning when -Wpointer-sign is enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-16 11:06:20 -04:00
Mariusz Skamra 4e6495c832 Bluetooth: mesh_demo: Enable missing options in configuration file
This enables missing Observer and Brodcaster roles in configuration
file.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-27 12:50:24 +03:00
Johan Hedberg d41d9bd112 Bluetooth: Convert sample code to use the new bt_data_parse() API
Convert the shell and central_hr sample apps to use the newly
introduced bt_data_parse() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-26 19:34:57 +03:00
Sebastian Bøe 8f3fea300a cmake: bluetooth: Don't #include gatt files from src files
Due to a bug in KBuild, bluetooth samples needed to #include the gatt
sources to re-use code between samples. This bug was not ported to
CMake so we can stop applying this workaround.

gatt source files are now directly added to the 'app' library instead
of having adapter source files in the app's src directory that
\#include's the gatt files.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-13 15:14:40 +02:00
Ulf Magnusson 7a073bf9f5 samples: bluetooth: Fix microbit/nrf5 UART flow control assignments
The UART_NRFX_FLOW_CONTROL Kconfig symbol was renamed to
UART_0_NRF_FLOW_CONTROL in commit 3f99eefe5a ("drivers: uart: Rename
nrf5 namings to nrfx").

The assignments in samples/bluetooth/hci_uart/microbit.conf and
samples/bluetooth/hci_uart/nrf5.conf were updated in the same commit,
but to the wrong name. Change them to use the correct name.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-12 20:18:14 -04:00
Jakub Rzeszutko 3f99eefe5a drivers: uart: Rename nrf5 namings to nrfx
UART driver renamed to keep the same convention as SPI and TWI drivers.
All substrings: "UART_NRF5" in defines renamed to  "UART_NRFX_UART".

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-12 13:21:18 +02:00
Luiz Augusto von Dentz 68de9d5d66 Bluetooth: Use Characteristic attribute whenever possible
With updates to bt_gatt_notify and bt_gatt_indicate it is now possible
to pass the Characteristic attribute instead of its value which makes
the code able to verify if attribute properties are set correctly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-06-11 14:41:19 -04:00
Ulf Magnusson 337832d193 samples: hci_uart: Remove CONFIG_UART_NRF5_BAUD_RATE assignment
This symbol was removed in commit 748f724d82 ("serial: dts: remove
!HAS_DTS related Kconfig"). The setting should come from DTS now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-29 21:27:40 +03:00
Ulf Magnusson 31c5a83e7f samples: hci_uart: Remove NRF5 Kconfig baud rate setting
The UART_NRF5_BAUD_RATE Kconfig symbol was removed in commit
748f724d82 ("serial: dts: remove !HAS_DTS related Kconfig"). Looks
like this has been moved to DTS.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:19:59 -04: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
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
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 da82976eb6 Bluetooth: samples/mesh_demo: Add support for settings-based storage
Enable BT_SETTINGS and remove any custom flash access used for the
sequence number. We do settings_load() before bt_mesh_provision() and
use the return value from the latter to identity that settings_load()
had recoved a full configuration.

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 9e2189c4c1 Bluetooth: Mesh: Introduce generic storage timer
Instead of having an RPL-specific storage timer, introduce a generic
one that'll eventually be used for all persistent storage.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg 9540f7d52d Bluetooth: Mesh: Add skeleton for persistent storage
Add initial skeleton for doing settings-based persistent storage for
the mesh network state. This patch only includes restoring some core
network state such as IV Index, Sequence number, Net Keys, App Keys
and the Replay Protection list. The remaining state, and actually
storing the state, is left for follow-up patches.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-09 12:36:32 +03:00
Johan Hedberg b997a283f7 Bluetooth: Introduce skeleton for settings-based storage
Introduce a basic skeleton for peristent storage based on the settings
subsystem. Also enable support for this to the peripheral sample
application, so the new code gets exersized by CI. For now, the
implementation provides the same level support as the bt_storage API
ever did, i.e. for the identity address and the IRK.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Anas Nashif b3275d651c tests/samples: add hw dependencies
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 19:10:27 -04:00
Henrik Brix Andersen b27d96850f samples: bluetooth: Add Apple iBeacon demo application
Add a simple demo implementation of an Apple iBeacon BLE broadcaster.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-28 10:55:19 +03:00
Andrei Emeltchenko d665e12833 usb: hci_usb: Correct README
Correct README file

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko fc5134b03f usb: hci_usb: Fix test name
Correct test name

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko d38116cb03 usb: Use new USB Device interface for Bluetooth over USB sample
Use new interface for the sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko b6d912abf6 Bluetooth: hci_usb: Use USB Device defined VID / PID
Remove hardcoded INTEL_VENDOR_ID and PRODUCT_ID and use configuration
values.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Carles Cufi 81d211f3c8 samples: hci_uart: Add references to sections
Add a couple of references so that we can link to those from other
documentation sections.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-04-05 16:56:46 +02:00
Tomasz Bursztyka e7de85b534 samples/bluetooth: Move hci_spi to new SPI API
Removing old API usage.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka 324265420b api/spi: Disable legacy API by default
Let's start deprecation work of the SPI legacy API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Andrei Emeltchenko 0dfeb32a31 usb: Remove USB VID / PID for sanity check builds
We can use default values of CONFIG_USB_DEVICE_VID and
CONFIG_USB_DEVICE_PID for sanity check builds.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Andrei Emeltchenko 6f979c39eb Bluetooth: hci_usb: Simplify write function
Use net_buf primitives

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:04:18 +03:00
Carles Cufi 82f85c6565 doc: samples: hci_uart: Expand instructions for the Controller
Cover the required steps to use the Controller with Linux's BlueZ and
QEMU, and link to the relevant sections in the subsystem developer
guide.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Carles Cufi 9ba007e878 doc; bluetooth: Rework and expand the Bluetooth doc
In order to avoid duplication, move all information relating to QEMU and
BlueZ from samples to subsystems, and expand to cover BlueZ installation
and usage of Controllers with BlueZ and QEMU in detail.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Anas Nashif 993c350b92 cleanup: replace old jira numbers with GH issues
Replace all references to old JIRA issues (ZEP) with the corrosponding
Github issue ID.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-26 13:13:04 -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
Sundar Subramaniyan 4a90d97588 tests: samples: Add nrf52840_pca10056 board to USB test cases
Add nrf52840_pca10056 to platform whitelist for hci_usb and cdc_acm
samples.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-15 12:39:53 +01:00
Sundar Subramaniyan 3b857e1869 Bluetooth: hci_usb: Read the whole USB EPOUT buffer at once
btusb_bulk_out() reads the EPOUT buffer in multiple of 4 bytes because
of Quark's USB FIFO size limitation. But this has later been taken care
internally in the DW driver making it redundant in hci_usb.

Remove Quark specific handling and read the whole EPOUT buffer at once.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-09 21:46:59 -05:00
Sundar Subramaniyan 5c162dfe78 Bluetooth: hci_usb: Write large packets to USB in multiple chunks
try_write() writes the whole net buffer to USB which sometimes is larger
than the maximum packet size of an endpoint.

Use the ret_bytes param to know how much has been written to the USB bus
and write the remaining chunks in the subsequent calls.

Usually the USB driver write doesn't happen immediately in cases where
the usb_write() is not synchronous. In such cases, USB driver returns
-EAGAIN.

If driver returns -EAGAIN, yield so as to give other threads a chance
to run while waiting for previous USB write to complete.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-09 21:46:59 -05: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 67b321eec9 samples: bluetooth: mesh: Add basic documentation
Add documentation for the mesh and mesh_demo sample applications.

Fixes #6279

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-05 19:53:48 -05:00
Luiz Augusto von Dentz 5c464b1bcc Bluetooth: central_hr: Fix assigning temporary UUID to discovery
bt_gatt_discover_params parameter shall remain valid as long as the
procedure is in place.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 16:24:04 +02: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
Erwan Gouriou 1caea8738c samples: bluetooth/ipsp: Update multicast address
With current value of IPV6 Multicast address, IPV6 mcast bind
does not succeed and IPSP use case could not work.
Change use case multicast address to match IPV6 address and
enable binding

fixes: #6050

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-02-08 14:40:42 +02:00
Johan Hedberg 8fc4c99496 Bluetooth: Remove redundant AD parsing check
A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 07:01:10 -08:00
Kumar Gala 26e4da52cf arm: nordic: flash: Use FLASH_DEV_NAME define
We want to move to use a common FLASH_DEV_NAME across the various flash
drivers. So samples, tests, or other code can be a bit more generic.  So
replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-25 15:23:00 -06:00
Anas Nashif 33592e8aa8 cmake: remove IS_TEST handling
Depending on a path inside the Zephyr tree to determine if we are a test
does not scale. Also some samples were marked as TEST while they are
not, just to get some options defined for tests.

Idenitfying a test will be addressed in another patch introducing
CONFIG_TEST.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 10:03:57 -05:00
Anas Nashif b5b8095749 samples: bluetooth and net samples need test setup
remove build_only and make them depend on test harness (bluetooth)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Sebastian Bøe cf6cb590df cmake: Don't link with subsys__bluetooth unnecessarily
It is only necessary to link with subsys__bluetooth if the path
"subsys/bluetooth" is needed as an include directory. None of the
samples have this need.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-19 12:46:03 -05: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
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 4fe3e03152 Bluetooth: samples/mesh_demo: Fix address handling
Clean up and fix the address handling.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 13:30:30 +02:00
Johan Hedberg e31102c890 Bluetooth: samples/mesh_demo: Remove unused model publication
This app isn't (at least yet) using the model publication for
anything, and in fact this could cause trouble due to missing
publication net_buf_simple buffer.

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 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 bd69b2127e Bluetooth: Mesh: Use dedicated struct for heartbeat subscription
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Johan Hedberg d4365e16f9 Bluetooth: Mesh: Use dedicated struct for heartbeat publication
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Sebastian Bøe 49e7ca957e cmake: set IS_TEST in the samples that were including Makefile.test
For an unknown reason, various samples in KBuild were including
Makefile.test, this had some desired benefits, one of which is that
the popular BOOT_BANNER appears. The CMake-equivalent of including
Makefile.test is setting the flag IS_TEST. This commit reverts the
behaviour of the samples back to how it was pre-cmake.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Johan Hedberg e6aa6a0784 Bluetooth: samples/mesh_demo: Add heartbeat publication support
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +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 86624941e4 Bluetooth: samples/mesh_demo: Add dummy provisioning
Some of the provisoning routines, such as node reset assume that we
have a valid bt_mesh_prov pointer.

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 6f4d627983 Bluetooth: samples/mesh_demo: Convert to using Configuration Client API
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +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 b4700c3f2b Bluetooth: Mesh: Clarify API for empty model arrays
Avoid applications defining empty model arrays by themselves by
documenting the BT_MESH_MODEL_NONE helper macro (renamed to be more
intuitive) and using it in the mesh sample app.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Johan Hedberg a554ae2bc1 Bluetooth: Mesh: Remove reference to non-existing Kconfig option
There's no such Kconfig option as CONFIG_BT_MESH_TX_SEG_COUNT.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Johan Hedberg c7001a4620 Bluetooth: samples: Remove references to Kbuild-style building
Update the documentation for the Bluetooth samples not to refer to the
old style of building using make. Instead, simply refer to the general
instructions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-09 10:57:49 -05: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 09f646a628 cmake: Fixed NODE_ADDR
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 b451f132c5 samples: bluetooth/mesh: Add Friend support
Make it possible to use the mesh sample app as a Friend node.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-07 18:59:06 +03:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Anas Nashif 9b7abb9d8c samples: bluetooth: add nrf52_pca10040 to beacon sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Paul Sokolovsky 44e25bc53c Bluetooth: ipsp: Add detailed instructions
Given that 6lowpan/BLE support is still work in progress, uses
debugging interfaces to setup, has known issues, and otherwise
not widely known or adopted, provided detailed instructions,
including reasonable diagnosing steps on how to set up and test
such a connection.

Tested using 96b_carbon.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-30 08:10:35 -04:00
Johan Hedberg 5640b631b4 samples: mesh_demo: Enable relay by default for the micro:bit
The relay functionality was supposed to be always enabled rather than
always disabled on the micro:bit.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-23 12:39:52 +02:00
Andrei Emeltchenko 44a3cca2e2 usb: Remove default Vendor and Product ID
Vendor ID and Product ID should be assigned on build time by
respective process.

For sanity check we assign some random values which are only used for
build tests and should not be used for real products.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Johan Hedberg ee107baad9 samples: mesh_demo: Use second button to change target address
It's been observed that that the relay toggling functionality is not
very useful, and that it's better left enabled always. Change the
purpose of the second button to instead modify the target address that
messages sent through the first button get directed to. By default the
destination is the group address, i.e. all nodes receive the message.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-18 16:08:22 -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 18a33edd39 usb: fix local includes and add usb namespace
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -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
Luiz Augusto von Dentz 9b5d3f174f Bluetooth: ipsp: Add dedicated conf file for CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 shall only be used with hosts that are known to
not comply with RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz a4e176b6a3 Bluetooth: ipsp: Add note about the Linux 4.12 kernel release
Since 4.12 Linux kernel has fixes required to comply to RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz b81ab53f89 Bluetooth: ipsp: Add CONFIG_NET_APP_BT_NODE=y to prj_dbg.conf
CONFIG_NET_APP_BT_NODE is required in order for the Bluetooth L2 driver
to register IPSS service.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Andrei Emeltchenko 4efaefba5c usb: Allow to select configuration for composite devices
Composite multifunction USB devices should be able to know about
configuration change, implement it through existing callback.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Luiz Augusto von Dentz 154f32d9ca Bluetooth: ipsp: Remov ipss.c
This file is no longer needed as IPSS service is already enabled with
CONFIG_NET_L2_BT.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-18 10:21:11 -04:00
Carles Cufi 43fa93f682 samples: bluetooth: hci: Fix TX memory leak
Whenever a buffer is sent to the driver via bt_raw using bt_send() the
buffer might not be consumed if an error is returned. In that case
unreference the buffer to avoid leaking the already allocated net_buf.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-13 14:17:32 +02:00
Sebastian Bøe 76537ad1dd samples: Add bbc_microbit to hci_uart's whitelist
bbc_microbit has been observed to regress on this sample and is
therefore a good candidate for CI.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-09-07 07:04:22 -05:00
Carles Cufi 80e0f7939e Bluetooth: controller: Add DTM HCI commands
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-04 06:08:09 -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
Ricardo Salveti 4ff2c33451 Bluetooth: samples/hci_spi: increase BT_RX_BUF_COUNT to 10
Default BT_RX_BUF_COUNT value is not enough when transfering a large
amount of data (e.g. heavy network traffic over BT 6LoWPAN). Increase
BT_RX_BUF_COUNT from default value 3 to 10.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-17 08:20:18 +03:00
Paul Sokolovsky 7ef28df980 Bluetooth: samples: ipsp: Fix crash on TCP connection closure
Be sure to check for NULL pkt in receive callback, which means TCP
EOF. The fix ported from echo_server sample.

Jira: ZEP-2423

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 23:40:11 +03:00
Marti Bolivar cf9a5e352f doc: 96Boards Carbon: add Bluetooth setup docs
Add cross-referenced information on the 96b_carbon and
96b_carbon_nrf51 pages which disambiguates between the two "boards".
Also describe how to flash 96b_carbon_nrf51 with
samples/bluetooth/hci_spi and 96b_carbon with samples/bluetooth/ipsp
to support a Bluetooth HCI stack on 96Boards Carbon (the physical
board).

While we're here, make the documentation page for 96b_carbon match the
format in doc/templates/board.tmpl.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Marti Bolivar 7394401baf Bluetooth: ipsp: use sys_log
Various of the printk messages in this sample app don't have
newlines. Let's fix the output by moving to SYS_LOG_xxx() macros
instead, which don't need them anyway.  This also makes it easier to
tell errors apart from other messages, etc.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Ricardo Salveti 8dbb388000 samples: Bluetooth: add HCI SPI raw handler sample
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.

Currently, the sample only supports the legacy SPI API.

Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:

- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-15 22:58:02 +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 51252bdea4 Bluetooth: samples/mesh_demo: Fix tune generation with sharp notes
The parsing of strings with sharp notes (e.g. "100C#") was incorrectly
implemented. Now it should be correct. Additional benefit is that this
should fix Coverity CID 173632.

Jira: ZEP-2467

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-08 13:10:29 +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
Luiz Augusto von Dentz e57b7ec4ba Bluetooth: ipsp: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Johan Hedberg 0be8414e2f Bluetooth: samples/mesh: Increase GATT TX buffer count
Count of 4 seems to cause deadlocks with some Android phones due to
other GATT activity in addition to Mesh related data.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-03 13:10:30 +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 ee3b715d1d Bluetooth: samples/mesh: Update generic nRF51 16k configuration
Update the configuration with the latest fine-tuning that was already
present in microbit.conf.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Johan Hedberg 28ce610a06 Bluetooth: samples/mesh: Disable unnecessary debug logs
There's no need for debug logs by default in the mesh sample, and it
just contributes excessively to the ROM footprint.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Anas Nashif 977537107e samples: mesh: build sample where they fit
Not easily done using RAM/ROM filters, configurations need to be adapted
to make this fit on more devices. Limit the target platforms now while
we figure out configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-27 07:47:53 -04:00
Anas Nashif 9f642c4291 samples: mesh: build only on BLE platforms
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 07:23:14 -04:00
Paul Sokolovsky 4732452a42 samples: bluetooth: ipsp: Bump max number of contexts
This sample includes builtin UDP and TCP echo servers, max
MAX_CONTEXTS=3 as set previously, they just didn't work.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-22 10:33:29 +03: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
Luiz Augusto von Dentz ca9c8a2627 Bluetooth: ipsp: Remove requirements section
All supported driver are HCI based so there is no need have it state on
the README.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-17 17:45:46 +02:00
Luiz Augusto von Dentz 94409a14ae Bluetooth: ipsp: Disable debug options
This disable debug options in order for the image to fit in boards
such as arduino_101 and quark_se_c1000_devboard.

For convenience this adds another configuration file with as it was
available previously which can be build using:

make CONF_FILE=prj_dbg.conf

JIRA: ZEP-2378
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-12 17:37:45 +03:00
Geoff Gustafson 1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Kumar Gala 5920acef8a samples: mark samples that require usb_device support
Add depends_on usb_device for those samples that need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Jukka Rissanen 3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Carles Cufi c170855825 Bluetooth: hci_uart: Set the UART TX size correctly
Since the controller comes with a transmit buffer size that mirrors the
maximum size of a transmit packet, use that to size the buffers that are
used in the hci_uart application to receive packets from the Host over
the UART.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-05 16:59:31 +02: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
Vinayak Kariappa Chettimada 6cc00f0ee3 Bluetooth: samples: scan_adv: Select BROADCASTER and OBSERVER
Explicitly select CONFIG_BLUETOOTH_BROADCASTER and
CONFIG_BLUETOOTH_OBSERVER in the scan_adv sample.

If the Controller is included without connections support
then only broadcaster support is compiled in by default,
hence add broadcaster and observer role support explicitly
in the prj.conf file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-30 13:42:33 +03:00
Johann Fischer 08df5961b3 arch: intel_quark: use DW device driver when USB is selected
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 15:14:15 -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
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 3afb47887f samples: hci_uart: optimize testcase definition
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Carles Cufi 634d3b46a9 Bluetooth: Set hci_uart RAM config to fit privacy
With the introduction of privacy, the system workqueue is now being
linked into the image, growing the RAM footprint considerably.

In order for the sample to fit in QFAA and QFAB variants of the nRF51
(16KB of RAM) we reduce the workqueue stack size to 512 since the RPA
update mechanism doesn't use more than 340 bytes and we stick to 16
connections maximum.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-22 14:40:23 +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
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05: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
David B. Kinder 342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Andrew Boie e87eacacfa samples: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Sharron LIU 3970cd4a87 samples: fixed typo in README.rst
Per ISSM team feedbacks:
“demostrating” >> “demonstrating”
“demonstates” >> ”demonstrates”

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-07 22:53:54 -04:00