Commit Graph

1090 Commits

Author SHA1 Message Date
Gerard Marull-Paretas f4417dab46 device: remove PM capability from SYS_DEVICE_DEFINE
The macro already mentions in the docstrings that PM is not supported:

"Invokes DEVICE_DEFINE() with no power management support".

This patch removed the PM entry from the macro and ajusts its uses.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Emil Gydesen 19c032ed78 Bluetooth: ISO: Rename bt_iso_cig_create_param
Renames the struct from bt_iso_cig_create_param to
bt_iso_cig_param as the same struct can, without
modification, be used to update the CIG as well
(function to support that will come in a later commit).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen ba0a053f94 Bluetooth: ISO: Change CIG/BIG to use slist instead of array
A CIG may be updated later to include more CIS, and thus a slist
makes more sense.

The BIG doesn't need the change, but it makes more sense to
have similar handling for both.

This change also removes the requirement that the arrays
used to create the CIG/BIG need to static.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen 12decc70d0 Bluetooth: ISO: Add bitmask for retrieving iso header lenght
Add a macro to retrieve the iso data load length (the
length stored in the iso header) with a bit mask that
ensures that we only take the first 14 bits.

This is to remove any RFU bits that may have been set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-12 14:52:33 +01:00
Emil Gydesen 08b1dfb4a2 Bluetooth: ISO: Fix incorrect struct for ISO hdr data
There were a few cases where bt_hci_iso_data_hdr was used
instead of the proper struct bt_hci_iso_hdr.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-12 14:52:33 +01:00
Andrzej Głąbek cd2236c199 samples: hci_spi: Decrease maximum number of BT connections
With the maximum number set to 20, the sample fails to build for
both platforms set as allowed for this sample and mentioned in its
documentation, i.e. 96b_carbon_nrf51 and nrf51dk_nrf51422 (a build
attempt ends up with an SRAM region overflow). Use a lower number
to prevent this failure and set both those boards as integration
platforms, so that such problem, if it was to appear again, could be
caught by CI.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-11-06 13:54:08 +01:00
Vinayak Kariappa Chettimada 5f5a50aa14 tests: Bluetooth: bsim: Add iterations to multiple conn to peripherals
Add iterations of connections and disconnections to
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Enable Auto PHY Update and Auto Data Length Update procedure
in the central_multilink sample.

Enable Auto PHY Update and Auto Data Length Update procedure
in the peripheral_identity sample. Fixed issues related to
rotation of identities after maximum number of connection
iterations are repeated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Vinayak Kariappa Chettimada 80d590c689 samples: Bluetooth: periodic_adv: Add Extended Advertising disable
Add implementation to iteratively perform Extended
Advertising enable and disable while Periodic Advertising is
active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:51:40 +01:00
Sylvio Alves 220a55f5fd samples: hci_uart: esp32: add overlay and config files
Enabling hci_uart sample requires changing
max BT connections and proper uart overlay. Use
this as sample for ESP32 soc.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-11-03 15:12:30 +01:00
Henrik Brix Andersen 265cdf8dc6 cmake: use find_package() instead of literal include in tests and samples
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-11-01 10:33:09 -04:00
Jacob Siverskog 046f29a8cb Bluetooth: ATT: Fix typo in defines
Fix typo in ATT first/last attribute defines.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-10-23 20:39:36 -04:00
Abe Kohandel 190848177e bluetooth: ots: Enable testing with assert
Fix compilation and logic issues to allow testing OTS functionality with
assert enabled.

The compilation fixes are simple and do not require an explanation.

The assertion in bt_ots_dir_list_init was logically reversed. Its
purpose is to ensure the directory list is not already initialized
and as such should assert that the dir_list is not set (i.e. is NULL).

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-10-21 11:21:13 -04:00
Emil Gydesen a56cbed603 Bluetooth: ISO: Split ISO broadcast config
Splitt he ISO broadcast config into broadcaster and
sync receiver. This will allow a device that only
wants to one of the roles to have a much more optimized
configuration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-18 12:43:38 +02:00
Piotr Pryga fba51111cf samples: Bluetooth: df: enable filtering of per adv by CTE type
Enable filtering of periodic advertisements to synchronize
with advertisenemts that include CTE.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-07 21:36:55 -04:00
Emil Gydesen 8d20e8d5bc Bluetooth: ISO: Add iso accept info struct
Add a new struct that provides information to the upper
layer when accepting an connected isochronous stream.

The CIG ID and CIS ID makes it possible for the upper layer
to determine which ISO channels are "together" in a group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-28 20:19:37 -04:00
Emil Gydesen 5a11a19713 Bluetooth: Iso: Add BT_ISO_SDU_BUF_SIZE macro
Add the BT_ISO_SDU_BUF_SIZE which can be used to declare
the TX buffers for ISO, similar to the BT_L2CAP_SDU_BUF_SIZE
macro for L2CAP.

This also updates the ISO samples to use this as well
updating the SDU check to use
CONFIG_BT_ISO_TX_MTU/CONFIG_BT_ISO_RX_MTU without
subtracting the BT_ISO_CHAN_SEND_RESERVE to make the
API more clear.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-28 20:07:32 -04:00
Carles Cufi 0552d329c8 samples: bluetooth: hci_uart: Fix command len calculation
Due to a historical error introduced during an hci_uart refactor, the
get_len() function was using the wrong HCI H4 packet identifier for
commands. Instead of using H4_CMD (0x01) it was trying to match
BT_BUF_CMD (0x00).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-07 20:47:49 +02:00
Emil Gydesen c17f28c3d6 Bluetooth: sample: Add ISO support to hci_uart
Add ISO support to the hci_uart sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-06 09:18:58 -04:00
Nikolai Kondrashov 77ee1f02aa doc: Fix a few typos in docs/comments/messages
Fix two typos in documentation, one in a sample's comment, and one in a
sample's console message. Found while learning Zephyr and exploring the
sources.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2021-09-03 06:06:59 -04:00
Emil Gydesen bebfdaf88b Bluetooth: samples: Improve disconnect handling iso_connected_benchmark
Improve the disconnect handling in the sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Emil Gydesen 84ac32e32d Bluetooth: samples: Improve disconnect handling in central_iso
Improve the disconnect handling in the sample, and
avoid creating a new cig for each connection.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Emil Gydesen 891d838140 Bluetooth: samples: Fix iso_connected_benchmark disconnect
The disconnect handling of ACL connects in the sample was done
incorrect, and caused a call to bt_conn_unref with a NULL
pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Lingao Meng 34a1d676c9 samples: bluetooth: Fix scan filter
We should use no filter filter to process adv data
according to code comment above.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-02 19:35:26 -04:00
Emil Gydesen 93bfe7a2c9 Bluetooth: ISO: Update BIS index to start from 0x01
The HCI spec defines the BIS index range as starting from
index 0x01. We had previously implemented it such that it
starts from 0x00, and then simply adding 1 to the index
when sending over HCI. However, this may cause issue with
other HCI, or other SIG defined specification, commands
and events, and thus it is probably simpler if we just
use the HCI defined range.

This commit disallows BIT(0) (representing the BIS
index 0x00) to be set, and removes the addition
of 1 when sending over HCI.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-01 10:57:07 -04:00
Andrzej Kaczmarek f353202eb7 Bluetooth: Controller: Fix DF for per adv chains scanning
This updates DF to properly receive CTE in per adv chains scanning.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Emil Gydesen 8490508b59 Bluetooth: ISO: Make ISO/ACL bt_conn pointers clear in ISO API
Update the name of the bt_conn pointers to make it clear
whether the connection pointers are ACL or ISO connections.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 11:46:07 -04:00
Emil Gydesen ed46180ab8 Bluetooth: samples: Update iso parameter check in iso_broadcast_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Emil Gydesen 90eb48b111 Bluetooth: samples: Update iso parameter check in iso_connected_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Piotr Pryga 50a2cdd75a samples: Bluetooth: df: Enable TX of mutliple CTEs in a per adv event
Since periodic advertising chains are available there is
a possibility to send multiple PDUs including CTE in
a periodic advertising event.

This commit enables such functionality in direction finding
transmitter sample.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-26 18:25:35 -04:00
Emil Gydesen 77509a31d5 Bluetooth: sample: Update default latency of iso broadcast benchmark
The default latency (0) is an invalid value (minimum is 5).
Set to 10 to match the connected ISO benchmark.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:16 -04:00
Emil Gydesen fc33f6af3a Bluetooth: sample: Update iso_broadcast_benchmark to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen 1d1cd57c41 Bluetooth: sample: Update iso_broadcast to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen 76091850c5 Bluetooth: sample: Update iso_connected_benchmark to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen 23f3aa12ae Bluetooth: sample: Update central_iso to use new ISO API
Update the central_iso sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Joakim Andersson 4a97fa310b Bluetooth: samples: Update periodic advertising data update rate
Update periodic advertising data update rate. The periodic advertiser
is configured with a periodic advertising interval of 2.4 seconds but
updating the data every second. This leads to many of the advertising
data values not being sent at all.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-19 10:20:14 -04:00
Joakim Andersson 06034329dd Bluetooth: hci_uart: Add workaround for no command buffer available
Add workaround for no command buffer available when the host is
transmitting Host Number of Completed Packet Commands.
This command does not follow normal flow control of HCI commands and
the controller side HCI drivers that allocates HCI command buffers with
K_NO_WAIT can end up running out of command buffers.

Increase the command buffer count from 2 to 10 for the HCI uart driver
until the issue has a proper fix

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-18 12:17:36 +02:00
Martí Bolívar ef54f3d5ce doc: samples: bluetooth: DFE fixes
The documentation for Bluetooth Direction Finding Extension (DFE)
samples has various issues:

- references to 'child' images, which do not exist in mainline zephyr

- invalid RST syntax: there are missing ` characters to end arguments
  to :zephyr_file: roles, creating unintelligible output

- incorrect RST usage:

   - using :zephyr_file: instead of :file: when referring to a file
     that the user must create, creating broken links to nonexistent
     files in the zephyr tree

   - using :code: instead of :kconfig: to refer to kconfig options,
     creating output without links to the help for those options

- redundant or duplicated information

- grammar, typos, various bits and pieces

Clean this up. As part of that, move various common bits and pieces of
information to the devicetree bindings index so they can just be
linked to from the sample docs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-17 17:52:43 -04:00
Joakim Andersson 81614307e9 Bluetooth: Add workaround for no command buffer available
Add workaround for no command buffer available when the host is
transmitting Host Number of Completed Packet Commands.
This command does not follow normal flow control of HCI commands and
the controller side HCI drivers that allocates HCI command buffers with
K_NO_WAIT can end up running out of command buffers.

Increase the command buffer count from 2 to 10 for the affected drivers
until the issue has a proper fix.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-16 15:12:22 -04:00
Lingao Meng 8e1682d1ea samples: conn_cb replace to const zsector
It is more efficient and saves part of RAM
by replacing it with static one dynamically.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Johann Fischer 946964e374 samples: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Abe Kohandel dcaac1e7af bluetooth: ots: Make OTS Object Reads use POSIX parameter types
It is desirable to have the read and write like functions follow the
POSIX read and write parameter types.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-08-03 13:16:51 +02:00
Abe Kohandel 997bbcb000 bluetooth: ots: Add object write procedure
Add the ability to perform an OTS Write Procedure with only Patch
support configuration.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-07-31 23:16:11 -04:00
Emil Gydesen 7d07a941fa Bluetooth: samples: Add ISO broadcast benchmark sample
Adds a sample that measures packet loss and BIG sync
statistics.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-25 08:56:00 -04:00
Emil Gydesen 3a6952e3e6 Bluetooth: iso: Compile conn.c for BT_ISO even without BT_CONN
If BT_ISO is enabled we now compile conn.c which contains a
lot of functionality used by BT_ISO, even for broadcast-iso
builds, i.e. builds that do not require BT_CONN.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Julia Hathaway 3ba485aad9 samples/hci_uart: doc: Fix reference to debug probes page
Changes reference link to the ST-Link debug probes section to match
new labeling.

Signed-off-by: Julia Hathaway <julia.hathaway@nxp.com>
2021-07-22 17:33:43 -04:00
Marek Pieta 573e70b474 samples: hci_rpmsg: Use release configuration by default
Change removes logs and assertions from default configuration.
They can be optionally enabled with debug_overlay.conf.
CONFIG_BT_BUF_CMD_TX_COUNT is increased to avoid dropping
HCI commands.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-07-22 22:42:22 +03:00
Vinayak Kariappa Chettimada ac82fbfad8 samples: Bluetooth: Option to have scanning in peripheral
Option to have continous scanning simultaneously while
advertising and multiple peripheral role is active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Vinayak Kariappa Chettimada fd3655352c samples: Bluetooth: Multiple central connections to peripherals
Application demonstrating Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Vinayak Kariappa Chettimada 4c6174d511 samples: Bluetooth: Mutiple peripheral identity
Added sample to demonstrate use of multiple identity and be
able to be connected to multiple times from same central
device.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00