Commit Graph

1132 Commits

Author SHA1 Message Date
Robert Lubos bb5909f7d1 net: tcp: Update receive window in other direct net_context users
As the receive window is now decreased at the TCP module level, other
direct net_context users are also responsible for acknowledging the
received data with net_context_update_recv_wnd() - otherwise, the
communication will stall.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-11 09:21:51 +01:00
Emil Gydesen 0d719ba893 Bluetooth: Audio: Add endpoint type to capabilities config cb
The capabilities callback did not provide information about
the type of the endpoint being configured, making it
impossible for the application to determine if it is a
sink or source endpoint.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen b880637231 Bluetooth: Audio: Remove bidirectional audio streams
Audio streams as defined by the BAP spec does not
support bidirectional audio streams. This commit
updates the API and implementation to match that.

The use a bidirectional CIS with 2 audio stream will
be added in a future commit.

This removes the _IN_ and _OUT_ and _INOUT_ QOS
values, as well as the direction of the codec QOS
struct.

To keep direction for internal use, the direction
has been added to the endpoint struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen e485305b7c Bluetooth: Audio: Fix ordering of array size after array parameter
Make it consistent for audio.h and capabilities.h that the
array size parameter appear after the array parameter.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen a01cc054c9 Bluetooth: Audio: Use size_t for audio.h array len arguments
Use size_t instead of uint8_t to describe array lengths.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen 452b897aec samples: Bluetooth: Add missing bt_conn_ref for a few samples
Some samples were missing a call to bt_conn_ref when assigning
default_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Kamil Piszczek cf6a58d3f6 bluetooth: hci: rpmsg: use ipc service library
The Bluetooth HCI driver based on the RPMsg transport now uses the IPC
service module. The compatible Bluetooth sample - HCI RPMsg - has also
been migrated to the new IPC solution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-02 17:03:01 +01:00
Gerard Marull-Paretas 260deccb6e doc: use :kconfig:option: domain role
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-02 09:28:37 +01:00
Vinayak Kariappa Chettimada 8a8d26b98d samples: Bluetooth: Add Synchronized Receiver board specific conf files
Add Synchronized Receiver board specific conf files.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Vinayak Kariappa Chettimada 13c41c0bc1 samples: Bluetooth: Add ISO Broadcaster board specific conf files
Add ISO Broadcaster board specific conf files.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Emil Gydesen 628b54a959 Bluetooth: Audio: Remove ISO disconnected and connected cbs
The callbacks were implemented to notify the application
about the state of the ISO. However, since then, callbacks
such as `started` and `stopped` have been implemented,
and as such the `connected` and `disconnected` callbacks
no longer server any purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-28 11:04:37 +01:00
Mariusz Skamra 8da5fefce2 samples: unicast_audio_server: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Casper Bonde 86574107dd Bluetooth: BAP: Unicast client sample accept EXT_ADV
Minor change to let the client accept EXT_ADV reports
when connecting.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2022-02-22 10:23:44 +01:00
Herman Berget 8b46aaaf69 Bluetooth: Add common BT_CONN_INTERVAL_TO_MS macro
The same macro was defined in multiple places.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-21 19:40:42 -05:00
Emil Gydesen 8671fa683e Samples: Bluetooth: Remove RX workround for iso connected benchmark
CONFIG_BT_ISO_TX_MTU=230 had been added to deal with the RX
buffers not fitting TX's of same size, which is fixed now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-21 19:40:02 -05:00
Piotr Pryga c3696cf06c samples: Bluetooth: df: add missing integration platforms
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga 63cc9decf7 Bluetooth: samples: df: Decrease RAM usage in DF connectionless RX
Direction finding connectionless RX sample didn't fit into
nRF52820 SRAM. The sample will not be able to store IQ samples
for maximum number of CTEs allowed by Bluetooth Core 5.3
specification.

For nRF52820 the new allowed maximum number of scanned CTEs
is set to one, to save more space in SRAM for an application.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga 4f17726bb1 samples: Bluetooth: df: Fix problem with samples split build
Fix problem with building sample applications where Host is
split from Controller into separate binaries. In that situation
samples does not have access to controllers Kconfig options.
To optimize memory usage by an application, disable not needed
features (angle of arrival or angle of departure).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga 2b3ec2bd96 Revert "samples: Bluetooth: df: Forward GPIO pins from app to network core"
This reverts commit 9bd218347c.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 14:12:13 +01:00
Piotr Pryga f126d23b67 Revert "samples: Bluetooth: df: add missing integration platforms"
This reverts commit ba939b1262.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 14:12:13 +01:00
Piotr Pryga ba939b1262 samples: Bluetooth: df: add missing integration platforms
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 09:56:34 +01:00
Piotr Pryga 9bd218347c samples: Bluetooth: df: Forward GPIO pins from app to network core
To give control over GPIO pins for Direction Finding Extension of
Radio peripheral when build for nRF53 network core, the application
core has to assign those pins to network core.

There is a mechanism that uses a device tree overlay to get
information about GPIO pins to be assigned to network core.

The commit adds overlays with appropriate configuration
to assign GPIO pins in all DF related samples.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 09:56:34 +01:00
Piotr Pryga 2f8a579ba6 samples: Bluetooth: df: Fix periodic sync termination handling
There was a bug it periodic advertising sync termination handling.
If a sync was terminated before sync established was reported,
for example sync may be filtered out by CTE type, then sample
will wait until sync_create_timeout_ms is reached.
Also sem_per_sync_lost semaphore is given in term_cb.
Result of the bug is next time a sync is established, CTE sampling
is enabled, sample starts waiting for periodic sync lost and
immediately ends waiting because sem_per_sync_lost is given.
Scan is restarted and already synchronized sync is terminated.

Correct behavior is, when term_cb is executed sem_per_sync_lost
may be given only if sync established was already reported.
Also sample must not wait for sem_per_sync if sync is terminated
due to wrong CTE type. It can end wait immediately.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-15 18:37:40 +01:00
Piotr Pryga 8f56d4ee19 samples: Bluetooth: df: Remove dep on CTLR Kconf in sample sources
Direction finding samples had dependency on KConfig option defined
in Controller. That caused a problem for split builds where
an application and host are not part of the same binary as
controller. The code dependend on the Kconfig option
was always disabled.

To fix that issue new Kconfig options were introduced to
Host. The dependency is removed. Unwanted features may stil be
disabled and samples binaier will be smaller.

The commit aligns all direction finding samples code.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Emil Gydesen f24d4bcf75 Bluetooth: Samples: Add unicast audio client and server samples
Adds Basic Audio Profile (BAP) unicast server and client samples.

These are the barebones versions of what is needed to scan/advertise
for audio and setup a stream using the mandatory LC3 preset defined by
the BAP spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen ed268b734d Bluetooth: Samples: Add controller Kconfig requirement for ISO samples
Add reference to specific CONFIG_BT_CTLR_ Kconfig options
for the ISO samples. This is due to the fact that ISO
isn't fully supported in the Zephyr controller yet, and
won't be enabled by default for a while yet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-26 13:29:45 +01:00
Emil Gydesen 59840b1a7b Bluetooth: Samples: Iso connected benchmark fix unidirectional tx
Add a check for SDU size and tx qos to ensure that we do not
attempt to send any data and neither central or peripheral
if the benchmark has been setup to be rx-only.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-21 14:25:04 -05:00
Emil Gydesen e6265685a1 Bluetooth: Sample: ISO connected benchmark change to callback
Change the sample to use the callback instead of a timer
to send next packet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-21 14:25:04 -05:00
Piotr Pryga 6590ffd330 samples: Bluetooth: df: Fix too early per sync create timeout
Periodic advertising synchronization create had a timeout set
to fixed value of 10 seconds. BT 5.3 Core specification defines
synchronization timeout as 6 consecutive periodic advertising
events. When advertiser set the periodic interval to be more than
1.6 second it was possible the application timeout is reached
before time allowed by BT Core specification.

Changed implementation of timeout to depend on the periodic
advertising interval.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 19:32:17 +02:00
Piotr Pryga bda4eea41d samples: Bluetooth: df: Add DF peripheral sample
Add new sample application for direction finding to show
how the functionality works in connected mode for peripheral role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 10:50:21 -05:00
Piotr Pryga 1acf326993 samples: Bluetooth: df: Add DF central sample
Add new sample application for direction finding to show
how the functionality works in connected mode for central role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 10:48:26 -05:00
Krzysztof Chruscinski 262cc55609 logging: Deprecate v1, default to v2
Reduced logging mode selection to deferred, immediate, minimal and
frontend. Decoupled logging version from mode and created CONFIG_LOG1
which can be used to explicitly select deprecated version.

From now on, chosing CONFIG_LOG_MODE_{IMMEDIATE,DEFERRED} will result
in version2.

Deprecated CONFIG_LOG2_MODE_{IMMEDIATE,DEFERRED} with cmake warning.

Codebase adapted to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-17 15:49:10 -05:00
Piotr Pryga ab32c06275 samples: Bluetooth: df: Fix possible stack overflow issue
Host receive thread has small default stack size.
Attempt to convert data from binany to string requires
large array. Allocation of such array on stack could
cause stack overflow.

To limit the scope of the array and avoid stack overflow
the array is changed to be static local variable in a function.

Also the array has been prepared to accept max advertising
data sieze of 1650 bytes.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-17 12:54:10 -05:00
Henrik Brix Andersen 2c0e0a74af doc: use extlink for github issue links
Use extlink for GitHub issue links in documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-17 12:48:43 -05:00
Piotr Pryga 3b5c1efc16 Bluetooth: host: Align usage of cte_type in DF host implementation
The CTE type is used in two ways by HCI layer:
1) single value representing particular CTE type: AoA, AoD 1 us,
  AoD 2 us
2) bit-filed where bits 0-2 represent particular CTE types AoA
  AoD 1 us, AoD 2 us

The bit-field is used to inform Controller about allowed types
of CTE, hence single value carries more than one value.
To avoid confusion between these use cases in code that refers
to case 1) all named cte_type (singular form). For case 2)
cte_types (plural form) is used.

There is an enumeration that is used for both cases:
bt_df_cte_type. For cte_type only single value from the
enumeration may be assigned to variable except
BT_DF_CTE_TYPE_NONE and BT_DF_CTE_TYPE_ALL.
For cte_types all enum members may be used. Ocasionally
BT_DF_CTE_TYPE_NONE may be excluded. If that is true,
it is described in code documentation.

Thanks to that applications are released from requirement
to include hci.h header file.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 16:02:40 +01:00
Gerard Marull-Paretas bcab9f9ac5 samples: bluetooth: hci: replace SYS_DEVICE_DEFINE with SYS_INIT
SYS_INIT can be used for the same purpose, what is being run is simply
an initialization hook.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-24 20:59:10 -05:00
Erwan Gouriou 215822d161 samples: Take into account PINCTRL in minimal configurations
Now that PINCTRL is available, don't forget to disable it
in minimal configurations.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-12-21 18:30:35 +01:00
Robert Lubos 666e9f80d6 net: ipv6: Remove in6_addr from packed net_ipv6_hdr struct
Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.

Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Yeshvanth M a1947006d6 samples: Bluetooth: Added Observer sample
This sample scans for nearby BLE devices and prints the address of the
device found and the RSSI value to the UART terminal.

Uses passive scanning and demonstrates the role of the observer.

Signed-off-by: Yeshvanth M <yeshvanthmuniraj@gmail.com>
2021-11-25 17:09:32 +02:00
Yeshvanth M 118f37b574 samples: Bluetooth: Added Broadcaster sample
This sample periodically sends out advertising data packets with
manufacturer data element.

The content of data sent is a single byte indicating how many
advertising packets the device has sent which rolls back to 0 after 255.
Demonstrates role of broadcaster.

Signed-off-by: Yeshvanth M <yeshvanthmuniraj@gmail.com>
2021-11-25 17:09:32 +02:00
Abe Kohandel a6f932a194 bluetooth: ots: Add Create and Delete procedures
Add the ability to perform an OTS Create or Delete Procedure.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-11-24 21:49:11 +02:00
Jordan Yates df327eeb58 net: buf: `POOL_FIXED_DEFINE` explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
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