Commit graph

17 commits

Author SHA1 Message Date
Yong Cong Sin 1899e4f667 bluetooth: remove CONFIG_BT_DEBUG_LOG
`CONFIG_BT_DEBUG_LOG` has been deprecated for more than 2
releases, replace it with `CONFIG_BT` + `CONFIG_LOG`:

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Aleksandr Khromykh 327eb119b6 Bluetooth: Mesh: add tf-m support for ble mesh
This PR adds ability to build mesh with tf-m psa
for platforms those support tf-m.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-06-19 15:04:17 +02:00
Théo Battrel e458f5aae6 Bluetooth: Use Zephyr standard log system instead of bluetooth/common/log
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.

Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`

Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.

For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-25 17:08:36 +01:00
Ingar Kulbrandstad 7367980bea Bluetooth: Mesh: Extended advertiser as default
Setting the extended advertiser as default advertiser
to improve both preformence and reliability.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2022-11-01 08:52:56 +00:00
Joakim Andersson 6483e12a8a Bluetooth: Refactor bluetooth buffer configuration for simplification
Refactor and simplify the bluetooth buffer configurations to improve the
easy of configurations and eliminate invalid ones.
By moving configurations out of host and controller specific
configurations and into a common one it becomes easier to configure
the host and controller separately as the same configurations can be
used as would be for a combined build.

All HCI configurations are now given exluding the matching HCI header,
which eases the configuration as the application don't have to know the
different header sizes.
The BT_RX_BUF_LEN is split into ACL and Event, as well as the suprising
use of Command size.
BT_L2CAP_RX_MTU is removed as the stack does not support reassembling of
HCI ACL data to larger L2CAP PDUs. The application will have to set
ACL RX size and account for the L2CAP PDU header itself.
BT_EATT_RX_MTU was removed as it is only used for setting a different
default value for another option which leads to the stuck kconfig symbol
problem.

The configurations can be updated according to the table below:

** New configuration         | ** Old configuration
All configurations
BT_BUF_ACL_RX_SIZE           | BT_L2CAP_RX_MTU + 4
BT_BUF_ACL_RX_SIZE           | BT_RX_BUF_LEN - 4
BT_BUF_EVT_RX_SIZE           | BT_RX_BUF_LEN - 2
BT_BUF_CMD_TX_SIZE           | BT_RX_BUF_LEN - 3
BT_BUF_CMD_TX_COUNT          | BT_HCI_CMD_COUNT
BT_BUF_EVT_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_ACL_RX_COUNT
BT_BUF_EVT_DISCARDABLE_SIZE  | BT_DISCARDABLE_BUF_SIZE - 2
BT_BUF_EVT_DISCARDABLE_COUNT | BT_DISCARDABLE_BUF_COUNT
Controller-build
BT_BUF_ACL_TX_SIZE           | BT_CTLR_TX_BUFFERS_SIZE
BT_BUF_ACL_TX_COUNT          | BT_CTLR_TX_BUFFER
HCI-bridge
BT_BUF_ACL_TX_SIZE           | BT_HCI_ACL_DATA_SIZE
BT_BUF_ACL_TX_COUNT          | 6

Fixed invalid configurations setting either BT_L2CAP_RX_MTU or
BT_CTLR_DATA_LENGTH_MAX larger than BT_RX_BUF_LEN could lead to buffer
overruns.

Fix advertising report max data length calculation.
This always used the BT_DISCARDABLE_BUF_SIZE macro but this feature
can be turned off and advertising reports will be allocated from the RX
buffer in that case. Also controller-build does not have this buffer
(in hci_raw.c). Also the wrong HCI header was used in the calculation,
HCI event header should have been used instead of HCI ACL header.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-06 14:56:18 +02:00
Magdalena Kasenberg d0e0af74da Bluetooth: Add option to log btsnoops over RTT
There is a choice to log btmon logs over UART or RTT.
You can choose number of RTT buffer, set its name and size.

Replaced CONFIG_BT_DEBUG_MONITOR with CONFIG_BT_DEBUG_MONITOR_UART
for UART usage and CONFIG_BT_DEBUG_MONITOR_RTT for RTT.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2021-05-05 16:03:38 +02:00
Trond Einar Snekvik 824c2ebc58 Bluetooth: Mesh: Slab based segmentation handling
Allocates segmented message buffers as slabs in a common pool for RX and
TX. This reduces memory requirements for both TX and RX, as TX messages
can be stored without the network and advertising buffer overhead, and
RX can use only the slabs it needs, instead of allocating a full size
segmented message. This approach also removes the need for decrypting
the segments for each retransmission, reducing overall processing load.

Slab based segmentation for tx also introduces queuing of segmented
messages, which allows the application layer to send multiple messages
to the same destination without violating Bluetooth Mesh specification
v1.0.1, section 3.6.4.1. This mechanism is provided through a flag that
blocks segmented messages to a destination which a message is already
being sent to until the previous message finishes.

This changes the SDU size configuration to a symmetrical
RX_SEG_MAX/TX_SEG_MAX pair of configurations, plus a new segment pool
side configuration. It also removes the binding between the TX_SEG_MAX
config and the advertising buffers, reducing the minimum advertising
buffer count from 6 to 3.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-03-19 15:54:26 +02:00
Vinayak Kariappa Chettimada 0b878020f2 samples: Bluetooth: Increase ISR_STACK_SIZE value
Split Link Layer implementation uses 80 bytes more ISR stack
in comparison to Legacy Link Layer, hence increase the
required ISR_STACK_SIZE for the BBC micro:bit and other
nRF51 QFAA SoC based mesh and mesh_demo samples.

Fixes #20414.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-10 15:34:26 +02:00
Andy Ross f288d1e4a7 tests: samples: Apps shouldn't set tick rate
Tick rate is becoming a platform tunable in the tickless world.  Some
apps were setting it due to requirements of drivers or subsystems (or
sometimes for reasons that don't make much sense), but the dependency
goes the other way around now: board/soc/arch level code is
responsible for setting tick rates that work with their devices.

A few tests still use hard-configured tick rates, as they have
baked-in assumptions (like e.g. "a tick will be longer than a
millisecond") that need to be addressed first.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04: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
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
Vinayak Kariappa Chettimada 6a39ed084f Bluetooth: controller: Add Minimum Number of Used Channels Proc
Add implementation to support Bluetooth 5.0 Minimum Number
of Used Channels Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-08-21 08:41:56 -04:00
Carles Cufi 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 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
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