summaryrefslogtreecommitdiff
path: root/samples/bluetooth
AgeCommit message (Collapse)Author
2017-01-19license: Replace Apache boilerplate with SPDX tagDavid B. Kinder
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-18Bluetooth: samples/beacon: Print message at start of sampleLee Jones
This is very handy for debug purposes. It provides us with a reassurance that at least something is happening, even if initialisation does not complete (hangs forever). Change-Id: I6ac1bfec84f8a6694f82d14fdc5d2a27aa1fc634 Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-01-17Bluetooth: IPSP: Reuse buffer fragments instead of copyingLuiz Augusto von Dentz
The original buffer fragments can be used to send back a reply directly since Bluetooth doesn't add anything to then. Change-Id: Ifeac0e6c3abbd527c79912abc5f5b833b0b52171 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-17Bluetooth: hci_uart: Remove redundant idle & ISR stack size valuesJohan Hedberg
The idle stack already defaults to 256. The ISR stack size of 640 was intended to make the app fit on 16k nRF51 variants and is now the default, i.e. it doesn't need to be explicitly set anymore. Change-Id: I8db3c080e1f84c65b27f931fa48c75bd90a2d3cd Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-10build: abstract emulation and replace qemu goal with runAnas Nashif
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-08kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTSAnas Nashif
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate. Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06net: do not skip sanitycheck on samplesAnas Nashif
Change-Id: I781a908ad998211b34d5f05f53fbf3471e6b9f1b Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05bluetooth: hci_uart: Allocate 65 bytes for L2CAP packetsCarles Cufi
With LE Secure Connections the longest packet we require is 65 bytes long: 64 bytes of Public Key data + 1 byte SMP opcode. Extend the size of the L2CAP pool blocks so that they can fit such packets and therefore one can use 70-byte CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFER_SIZE to achieve LE Secure Connections pairing without HCI fragmentation. Change-id: I2f11b4277ec5a24ceba79bccc7d84c64065b6e84 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no> Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05Bluetooth: samples: handsfree application indicator callbackSathish Narasimman
Displays the present value of the indicators in the Handsfree application. Change-Id: I666ff2b15e70de8c1a26b902077d79c5c1a9d5fe Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05bluetooth: Tune stack sizes after measuring with hci_uartCarles Cufi
The following readings were obtained after running the peripheral and central_hr apps in qemu combined with the controller (hci_uart) on nRF51 and nRF52: Main Stack 380 Idle Stack: 68 ISR stack: 532 Controller RX Stack: 388 HCI TX Stack: 516 The numbers set in this change provide a safety margin from the ones measured empirically. Change-id: Ice7ad7f081502e0ea1accf856a7937c0bf0783b2 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05Bluetooth: ipsp: Port sample to native stackLuiz Augusto von Dentz
This port ipsp sample to use the native stack so it can be used once again. Change-Id: I7975b017b0aa5bd81a1701692ec81527e39d4701 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-05Bluetooth: hci_uart: Disable HCI ECC commands temporarilyCarles Cufi
HCI ECC commands are causing freezes in the controller build. Until further investigation is done disable them to avoid issues when running the controller standalone. Change-id: Ifab0fa362348b72e88adaa5250c914770e4a70ba Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no> Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05Bluetooth: Rename SEND_STACK to TX_STACK_SIZECarles Cufi
For consistency with RX_STACK_SIZE and the rest of stack sizes, rename to use the normal naming scheme. Change-id: Ib8d484482466fa8d629e6329e07b927abdd6f598 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no> Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05Bluetooth: Take advantage of new net_buf_add_mem() APIJohan Hedberg
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>
2016-12-24samples: fix path to sanitycheck scriptAnas Nashif
Change-Id: Ic8fae0617faa6495a30bee09b5457a080924172c Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19logging: move sys_log to subsys/loggingAnas Nashif
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-16Bluetooth: samples: Add extern "C" { } block to GATT header filesLuiz Augusto von Dentz
Adds extern "C" { } blocks to header files so that they can be safely used by C++ applications. Change-Id: I767a04635b38d8ef7a02e8c7da3a5c99b0bc7709 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16Bluetooth: Remove unnecessary runtime kernel object initializationJohan Hedberg
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-15libc: rework libc selection and reduce KconfigsAnas Nashif
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-15net: buf: Remove the need for net_buf_pool_init()Johan Hedberg
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-13random: Restructure RANDOM KconfigMarcus Shawcroft
Restructure the RANDOM Kconfig to match the structure used in other drivers with a single top level menu. Move the true random number generators to appear first in the menu, with pseudo generators at the bottom. Do not present pseudo generators if a true random generator is presented. This change implies that tests, samples and applications that require the random driver interface must now select CONFIG_RANDOM_GENERATOR. In order for tests and samples to build (and run) on platforms that have no random driver it remains necessary to select the CONFIG_TEST_RANDOM_GENERATOR. Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of enabling a random driver that delivers non random numbers for the purpose of testing only. Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13tests: Remove unnecessary CONFIG_TEST_RANDOM_GENERATORMarcus Shawcroft
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-13net: buf: Redesigned pool & buffer allocation APIJohan Hedberg
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-05Merge "Merge net branch into master"Anas Nashif
2016-12-03Bluetooth: Make bt_send stack requirements a Kconfig optionSzymon Janc
This allows to fine tune TX stacks size depending on selected HCI driver. If needed it can be used to tune for monitor too or other logging mechanism used. Change-Id: Ib501921da0b786e151083760d85ec58fe3c08b60 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-03Bluetooth: samples/hci_uart: Use proper stack declarationSzymon Janc
Use BT_STACK_NOINIT for tx stack declaration. This makes sure stack it properly alligned and account for k_thread overhead. Change-Id: I704958fcc3ce02aba913f6eaee13ae50d2a81591 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-03Bluetooth: hci_uart: Fix init order in hci_uart bootupCarles Cufi
bt_enable_raw() needs to be called before spawning the tx thread, otherwise there might be an HCI command processed from the UART before the HCI driver has been opened and therefore initialized. Change-Id: I050158bd48bebaf8fa2cf6b11efb54b531f70079 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-03Bluetooth: hci_uart: reduce configured stack sizesVinayak Chettimada
From stack_analyze function, used isr stack is 368 bytes with the controller build, main stack is 288 bytes and idle stack is 56 bytes. Hence, configuring sizes of 512, 512, and 256 bytes for isr, main and idle stacks respectively. Increased max connections from 16 to 20 utilizing the RAM free from the reduced stack sizes. Change-id: I67d073fd1893cafc53d36e89035a6fd931488a46 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-12-03Bluetooth: Controller: Implement ECC commandsCarles Cufi
Implement the 2 HCI commands that provide ECC public key and shared secret generation: - LE Read Local P-256 Public Key - LE Generate DHKey Jira: ZEP-1246 Change-Id: I79388bfdb9f2e28b9377b4bb6ee2caca25f33f3e Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-02net: Remove legacy Contiki based uIP stackJukka Rissanen
This commit removes the legacy Contiki based uIP stack. The new native IP stack must be used after this commit. The commit also removes following things: - legacy cc2520 driver - legacy ethernet drivers - legacy IP stack samples and changes these things: - disabled tests that only work for legacy IP stack - select new IP stack by default - enable random number generator by default as it is needed by the new IP stack Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-11-18Bluetooth: Use convenience macros for timeout durationsJohan Hedberg
Using the K_* macros makes it easier to read what exactly the various timeouts are. Change-Id: Ia405d3760b8e600af7e33a7221ef6ec717708973 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-12Bluetooth: Fix left-over usage of TICKS_NONE and TICKS_UNLIMITEDJohan Hedberg
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-11Bluetooth: samples/hci_ecc: Switch to using k_thread_spawn()Johan Hedberg
Switch from fiber_start() to k_thread_spawn(). Also switch to k_yield() from fiber_yield() in the same go. Change-Id: I2dc480310f981112063651b61b0ceedf38601bee Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11Bluetooth: Use proper timeout defines for net_buf_get_timeoutSzymon Janc
Use defines from k_fifo intead of legacy API. Change-Id: Ib8cf0d88240ef145da550b8cf83d2580e7140521 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11Bluetooth: samples: Fix use of deprecated sleep APISzymon Janc
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-11Bluetooth: samples: Fix using nano_delayed_work in eddystoneSzymon Janc
This fixes warnings related to the use of nano_delayed_work. Change-Id: Ie20fb47fc6d5c486ff885ad583354eb715d12c1b Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11Bluetooth: Use unified k_fifo API for FIFOsSzymon Janc
Change-Id: I6ddc24575e4bf3c3040945a2bdb62f153b15cdb3 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11Bluetooth: Controller: Improve default RX/TX buffer countsJohan Hedberg
Currently the ideal buffer counts for a controller-only build are 6 RX buffers and 7 TX buffers: ATT_MTU of 158 bytes can be sent in one connection interval of 6 tx/rx -es wherein connection interval is 7.5ms Change-Id: I64b4620c5e8e7db8d7ed72fa1db82e266e121f27 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11Bluetooth: samples/hci_uart: Remove redundant semicolonJohan Hedberg
Remove redundant semicolon from the end of a while loop. Change-Id: I02cef7879efe0d6eeae59595e14fb1d9b00a6d52 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11Bluetooth: samples/hci_uart: Declare assert handler only when neededJohan Hedberg
If support for the controller assert handler isn't enabled the function shouldn't exist. Change-Id: I72076eb1001980f102a0404c91d22e41582ced25 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11Bluetooth: samples/hci_uart: Remove dependency on controllerJohan Hedberg
Don't use a controller define if controller support is not enabled. Change-Id: I837b3b66f010dfbdf2d9099acd85fa29fce954b7 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11Bluetooth: Kconfig: Restructure for a more logical hierarchyJohan Hedberg
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-11Bluetooth: Controller: Add ASSERT info dump on HCI buildsCarles Cufi
When building Zephyr in the controller-only configuration, assertions that happen in the Link Layer code are not visible to the Host which is running on another HCI and connected via UART or USB to it. This patch allows the Controller code to output the assertion line number when in such a configuration, allowing the Host to view the event to help debugging. The event format used is temporary and will be replaced by a standardized Vendor Specific specification to come at a later time. Change-Id: I013ca6783a3fdedc47b171132919dd4798c66285 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-11Bluetooth: samples/hci_uart: Add micro:bit configurationJohan Hedberg
The BBC micro:bit doesn't have UART HW flow control, so it needs to be disabled to build for the board. The baudrate is also lowered to 115200 since 1Mbps is likely to be unreliable without flow control. Change-Id: I1725a2a1e46cfbc0f57b4f5c4ee57ff52d9670e9 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09Bluetooth: Sample: handsfree sample applicationSathish Narasimman
Samble bluetooth application for handsfree profile Change-Id: I280a313afef4c842896c6470a473127e03dacd88 Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2016-11-09Bluetooth: samples: Use consistent naming for HCI appsJohan Hedberg
The convention for Zephyr sample names is to use _ instead of - for delimiting words. Change-Id: I08a63e9f600deb38183f81ddb8f8bf407b6eec2e Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-04Bluetooth: Remove misleading NBLE mentions from sample README filesJohan Hedberg
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-04samples: tests: remove obsolete KERNEL_TYPE and kernel variablesAnas Nashif
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-01Bluetooth: samples/hci-uart: Fix minor style issuesJohan Hedberg
Fix minor style issues with excessive whitespace for alignment and lack of 'static' for the tx_fiber_stack. Change-Id: I0c761e94e6a6789a3772b08b0774cd1a5e73c2ef Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01Bluetooth: samples/hci-uart: Fix up configuration filesJohan Hedberg
Right now the hci-uart samples doesn't really work anywhere else than nRF5x, so make that the default configuration. Also rename the old prj.conf to generic.conf to give a generic starting point for creating configurations for other targets. Change-Id: I1c940339b457d0e77c8ddad4b2474fc7e5b12a51 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>