The new IS_ENABLED macro allows exposing conditionally enabled code always to the compiler, even though it may not ultimately end up being built. This is in particular useful for letting the compiler catch any logging format string errors. Introduce a new BT_DBG_ENABLED macro that c-files need to define before including <bluetooth/log.h> in order to choose whether BT_DBG() logs are enabled or not. When no Bluetooth logs are enabled the patch also modifies the log macros to have the format strings checked with the help of the __printf_like annotation and empty static inline functions. Change-Id: Ie6bc8e10727b5b306f3ed0f94089a07a22583d9b Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
496 lines
14 KiB
Text
496 lines
14 KiB
Text
# Kconfig - Bluetooth LE stack configuration options
|
|
|
|
#
|
|
# Copyright (c) 2015-2016 Intel Corporation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
comment "Host Stack Configuration"
|
|
|
|
# Stack size needed for executing bt_send with specified driver
|
|
config BLUETOOTH_HCI_TX_STACK_SIZE
|
|
int
|
|
# Even if no driver is selected the following default is still
|
|
# needed e.g. for unit tests.
|
|
default 256
|
|
default 256 if BLUETOOTH_H4
|
|
default 256 if BLUETOOTH_H5
|
|
default 640 if BLUETOOTH_CONTROLLER
|
|
|
|
config BLUETOOTH_HCI_RAW
|
|
bool "RAW HCI access"
|
|
help
|
|
This option allows to access Bluetooth controller
|
|
from the application with the RAW HCI protocol.
|
|
|
|
# Virtual/hidden option to make the conditions more intuitive
|
|
config BLUETOOTH_HCI_HOST
|
|
bool
|
|
default y
|
|
depends on !BLUETOOTH_HCI_RAW
|
|
select TINYCRYPT
|
|
select TINYCRYPT_SHA256
|
|
select TINYCRYPT_SHA256_HMAC
|
|
select TINYCRYPT_SHA256_HMAC_PRNG
|
|
|
|
config BLUETOOTH_RECV_IS_RX_THREAD
|
|
# Virtual option set by the HCI driver to indicate that there's
|
|
# no need for the host to have its own RX thread, rather the
|
|
# context that bt_recv() gets called in is already good enough.
|
|
# If this is set, the driver RX thread is required as the first
|
|
# thing to make a call to bt_rx_thread_ready().
|
|
bool
|
|
|
|
config BLUETOOTH_HCI_CMD_COUNT
|
|
int "Number of HCI command buffers"
|
|
default 2
|
|
range 2 64
|
|
help
|
|
Number of buffers available for HCI commands.
|
|
|
|
config BLUETOOTH_MAX_CMD_LEN
|
|
int "Maximum supported HCI command length"
|
|
default 64
|
|
default 255 if BLUETOOTH_BREDR
|
|
range 64 255
|
|
range 255 255 if BLUETOOTH_BREDR
|
|
help
|
|
Maximum length of each HCI command.
|
|
|
|
config BLUETOOTH_RX_BUF_COUNT
|
|
int "Number of HCI RX buffers"
|
|
default 10
|
|
default 3 if BLUETOOTH_RECV_IS_RX_THREAD
|
|
range 2 255
|
|
help
|
|
Number of buffers available for incoming ACL packets or HCI events
|
|
from the controller.
|
|
|
|
config BLUETOOTH_RX_BUF_LEN
|
|
int "Maximum supported HCI RX buffer length"
|
|
default 76
|
|
default 264 if BLUETOOTH_BREDR
|
|
range 73 2000
|
|
help
|
|
Maximum data size for each HCI RX buffer. This size includes
|
|
everything starting with the ACL or HCI event headers. Note that
|
|
buffer sizes are always rounded up to the nearest multiple of 4,
|
|
so if this Kconfig value is something else then there will be some
|
|
wasted space. The minimum of 73 has been taken for LE SC which has
|
|
an L2CAP MTU of 65 bytes. On top of this there's the L2CAP header
|
|
(4 bytes) and the ACL header (also 4 bytes) which yields 73 bytes.
|
|
|
|
config BLUETOOTH_UART_TO_HOST_DEV_NAME
|
|
string "Device Name of UART Device to an external Bluetooth Host"
|
|
default "UART_0"
|
|
depends on BLUETOOTH_HCI_RAW
|
|
help
|
|
This option specifies the name of UART device to be used
|
|
to connect to an external Bluetooth Host when Zephyr is
|
|
acting as a Bluetooth Controller.
|
|
|
|
config BLUETOOTH_RX_STACK_SIZE
|
|
int "Size of the receiving thread stack"
|
|
depends on BLUETOOTH_HCI_HOST || BLUETOOTH_RECV_IS_RX_THREAD
|
|
default 1024
|
|
default 512 if CONFIG_BLUETOOTH_HCI_RAW
|
|
range 1024 65536
|
|
range 512 65536 if CONFIG_BLUETOOTH_HCI_RAW
|
|
help
|
|
Size of the receiving thread stack. This is the context from
|
|
which all event callbacks to the application occur. The
|
|
default value is sufficient for basic operation, but if the
|
|
application needs to do advanced things in its callbacks that
|
|
require extra stack space, this value can be increased to
|
|
accommodate for that.
|
|
|
|
if BLUETOOTH_HCI_HOST
|
|
config BLUETOOTH_INTERNAL_STORAGE
|
|
bool "Use an internal persistent storage handler"
|
|
depends on FILE_SYSTEM
|
|
depends on PRINTK
|
|
help
|
|
When selected the application doesn't need to register its own
|
|
persistent storage handlers through the bt_storage API, rather
|
|
an internal default handler is used for this.
|
|
|
|
config BLUETOOTH_PERIPHERAL
|
|
bool "Peripheral Role support"
|
|
select BLUETOOTH_CONN
|
|
help
|
|
Select this for LE Peripheral role support.
|
|
|
|
config BLUETOOTH_CENTRAL
|
|
bool "Central Role support"
|
|
select BLUETOOTH_CONN
|
|
help
|
|
Select this for LE Central role support.
|
|
|
|
config BLUETOOTH_CONN
|
|
bool
|
|
|
|
if BLUETOOTH_CONN
|
|
config BLUETOOTH_L2CAP_TX_BUF_COUNT
|
|
int "Number of L2CAP TX buffers"
|
|
default 3
|
|
range 2 255
|
|
help
|
|
Number of buffers available for outgoing L2CAP packets.
|
|
|
|
config BLUETOOTH_L2CAP_TX_MTU
|
|
int "Maximum supported L2CAP MTU for L2CAP TX buffers"
|
|
default 23
|
|
default 65 if BLUETOOTH_SMP
|
|
default 253 if BLUETOOTH_BREDR
|
|
range 23 2000
|
|
range 65 2000 if BLUETOOTH_SMP
|
|
help
|
|
Maximum L2CAP MTU for L2CAP TX buffers.
|
|
|
|
config BLUETOOTH_L2CAP_TX_USER_DATA_SIZE
|
|
int "Maximum supported user data size for L2CAP TX buffers"
|
|
default 4
|
|
range 4 65535
|
|
help
|
|
Maximum supported user data size for L2CAP TX buffers.
|
|
|
|
config BLUETOOTH_ATT_PREPARE_COUNT
|
|
int "Number of ATT prepare write buffers"
|
|
default 0
|
|
range 0 64
|
|
help
|
|
Number of buffers available for ATT prepare write, setting
|
|
this to 0 disables GATT long/reliable writes.
|
|
|
|
config BLUETOOTH_SMP
|
|
bool "Security Manager Protocol support"
|
|
select TINYCRYPT_AES
|
|
select TINYCRYPT_AES_CMAC
|
|
help
|
|
This option enables support for the Security Manager Protocol
|
|
(SMP), making it possible to pair devices over LE.
|
|
|
|
if BLUETOOTH_SMP
|
|
config BLUETOOTH_PRIVACY
|
|
bool "Privacy Feature"
|
|
help
|
|
Enable local Privacy Feature support. This makes it possible
|
|
to use Resolvable Private Addresses (RPAs).
|
|
|
|
config BLUETOOTH_RPA_TIMEOUT
|
|
int "Resolvable Private Address timeout"
|
|
depends on BLUETOOTH_PRIVACY
|
|
default 900
|
|
range 1 65535
|
|
help
|
|
This option defines how often resolvable private address is rotated.
|
|
Value is provided in seconds and defaults to 900 seconds (15 minutes).
|
|
|
|
config BLUETOOTH_SIGNING
|
|
bool "Data signing support"
|
|
help
|
|
This option enables data signing which is used for transferring
|
|
authenticated data in an unencrypted connection.
|
|
|
|
config BLUETOOTH_SMP_SC_ONLY
|
|
bool "Secure Connections Only Mode"
|
|
help
|
|
This option enables support for Secure Connection Only Mode. In this
|
|
mode device shall only use Security Mode 1 Level 4 with exception
|
|
for services that only require Security Mode 1 Level 1 (no security).
|
|
Security Mode 1 Level 4 stands for authenticated LE Secure Connections
|
|
pairing with encryption. Enabling this option disables legacy pairing.
|
|
|
|
config BLUETOOTH_USE_DEBUG_KEYS
|
|
bool "Enable Security Manager Debug Mode"
|
|
depends on BLUETOOTH_TINYCRYPT_ECC
|
|
help
|
|
This option places Security Manager in a Debug Mode. In this mode
|
|
predefined Diffie-Hellman private/public key pair is used as described
|
|
in Core Specification Vol. 3, Part H, 2.3.5.6.1. This option should
|
|
only be enabled for debugging and should never be used in production.
|
|
If this option is enabled anyone is able to decipher encrypted air
|
|
traffic.
|
|
|
|
endif # BLUETOOTH_SMP
|
|
|
|
config BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
|
|
bool "L2CAP Dynamic Channel support"
|
|
depends on BLUETOOTH_SMP
|
|
help
|
|
This option enables support for LE Connection oriented Channels,
|
|
allowing the creation of dynamic L2CAP Channels.
|
|
|
|
config BLUETOOTH_GATT_DYNAMIC_DB
|
|
bool "GATT dynamic database support"
|
|
help
|
|
This option enables GATT services to be added dynamically to database.
|
|
|
|
config BLUETOOTH_GATT_CLIENT
|
|
bool "GATT client support"
|
|
help
|
|
This option enables support for the GATT Client role.
|
|
|
|
config BLUETOOTH_MAX_PAIRED
|
|
int "Maximum number of paired devices"
|
|
default 1
|
|
range 1 128
|
|
help
|
|
Maximum number of paired Bluetooth devices. The minimum (and
|
|
default) number is 1.
|
|
|
|
endif # BLUETOOTH_CONN
|
|
|
|
endif # BLUETOOTH_HCI_HOST
|
|
|
|
config BLUETOOTH_TINYCRYPT_ECC
|
|
bool "Use TinyCrypt library for ECDH"
|
|
select TINYCRYPT
|
|
select TINYCRYPT_ECC_DH
|
|
depends on BLUETOOTH_HCI_RAW || BLUETOOTH_HCI_HOST
|
|
help
|
|
If this option is set TinyCrypt library is used for emulating the
|
|
ECDH HCI commands and events needed by e.g. LE Secure Connections.
|
|
In builds including the BLE Host, if not set the controller crypto is
|
|
used for ECDH and if the controller doesn't support the required HCI
|
|
commands the LE Secure Connections support will be disabled.
|
|
In builds including the HCI Raw interface and the BLE Controller, this
|
|
option injects support for the 2 HCI commands required for LE Secure
|
|
Connections so that Hosts can make use of those.
|
|
|
|
config BLUETOOTH_MAX_CONN
|
|
int "Maximum number of simultaneous connections"
|
|
depends on BLUETOOTH_CONN || BLUETOOTH_CONTROLLER
|
|
default 1
|
|
range 1 64
|
|
help
|
|
Maximum number of simultaneous Bluetooth connections
|
|
supported. The minimum (and default) number is 1.
|
|
|
|
config BLUETOOTH_DEBUG
|
|
bool
|
|
|
|
choice
|
|
prompt "Bluetooth debug type"
|
|
depends on BLUETOOTH
|
|
default BLUETOOTH_DEBUG_NONE
|
|
|
|
config BLUETOOTH_DEBUG_NONE
|
|
bool "No debug log"
|
|
help
|
|
Select this to disable all Bluetooth debug logs.
|
|
|
|
config BLUETOOTH_DEBUG_LOG
|
|
bool "Normal printf-style to console"
|
|
select BLUETOOTH_DEBUG
|
|
select PRINTK
|
|
select SYS_LOG
|
|
help
|
|
This option enables Bluetooth debug going to standard
|
|
serial console.
|
|
|
|
config BLUETOOTH_DEBUG_MONITOR
|
|
bool "Monitor protocol over UART"
|
|
select BLUETOOTH_DEBUG
|
|
select PRINTK
|
|
select CONSOLE_HAS_DRIVER
|
|
help
|
|
Use a custom logging protocol over the console UART
|
|
instead of plain-text output. Requires a special application
|
|
on the host side that can decode this protocol. Currently
|
|
the 'btmon' tool from BlueZ is capable of doing this.
|
|
|
|
If the target board has two or more external UARTs it is
|
|
possible to keep using UART_CONSOLE together with this option,
|
|
however if there is only a single external UART then
|
|
UART_CONSOLE needs to be disabled (in which case printk/printf
|
|
will get encoded into the monitor protocol).
|
|
|
|
endchoice
|
|
|
|
config BLUETOOTH_DEBUG_COLOR
|
|
bool "Use colored logs"
|
|
depends on BLUETOOTH_DEBUG_LOG
|
|
select SYS_LOG_SHOW_COLOR
|
|
default y
|
|
help
|
|
Use color in the logs. This requires an ANSI capable terminal.
|
|
|
|
config BLUETOOTH_MONITOR_ON_DEV_NAME
|
|
string "Device Name of Bluetooth monitor logging UART"
|
|
depends on BLUETOOTH_DEBUG_MONITOR
|
|
default "UART_0"
|
|
help
|
|
This option specifies the name of UART device to be used
|
|
for the Bluetooth monitor logging.
|
|
|
|
if BLUETOOTH_DEBUG
|
|
config BLUETOOTH_DEBUG_HCI_CORE
|
|
bool "Bluetooth HCI core debug"
|
|
help
|
|
This option enables debug support for Bluetooth HCI
|
|
core.
|
|
|
|
config BLUETOOTH_DEBUG_CONN
|
|
bool "Bluetooth connection debug"
|
|
depends on BLUETOOTH_CONN
|
|
help
|
|
This option enables debug support for Bluetooth
|
|
connection handling.
|
|
|
|
config BLUETOOTH_DEBUG_KEYS
|
|
bool "Bluetooth security keys debug"
|
|
depends on BLUETOOTH_HCI_HOST
|
|
depends on BLUETOOTH_SMP
|
|
help
|
|
This option enables debug support for the handling of
|
|
Bluetooth security keys.
|
|
|
|
config BLUETOOTH_DEBUG_L2CAP
|
|
bool "Bluetooth L2CAP debug"
|
|
depends on BLUETOOTH_CONN
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
L2ACP layer.
|
|
|
|
config BLUETOOTH_DEBUG_SMP
|
|
bool "Bluetooth Security Manager Protocol (SMP) debug"
|
|
depends on BLUETOOTH_HCI_HOST
|
|
depends on BLUETOOTH_SMP
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Security Manager Protocol (SMP).
|
|
|
|
config BLUETOOTH_SMP_SELFTEST
|
|
bool "Bluetooth SMP self tests executed on init"
|
|
depends on BLUETOOTH_DEBUG_SMP
|
|
help
|
|
This option enables SMP self-tests executed on startup
|
|
to verify security and crypto functions.
|
|
|
|
config BLUETOOTH_SMP_FORCE_BREDR
|
|
bool "Force Bluetooth SMP over BR/EDR"
|
|
depends on BLUETOOTH_DEBUG_SMP
|
|
help
|
|
This option enables SMP over BR/EDR even if controller is not
|
|
supporting BR/EDR Secure Connections. This optino is solely for
|
|
testing and should never be enabled on production devices.
|
|
|
|
config BLUETOOTH_DEBUG_ATT
|
|
bool "Bluetooth Attribute Protocol (ATT) debug"
|
|
depends on BLUETOOTH_CONN
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Attribute Protocol (ATT).
|
|
|
|
config BLUETOOTH_DEBUG_GATT
|
|
bool "Bluetooth Generic Attribute Profile (GATT) debug"
|
|
depends on BLUETOOTH_CONN
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Generic Attribute Profile (GATT).
|
|
|
|
config BLUETOOTH_DEBUG_RFCOMM
|
|
bool "Bluetooth RFCOMM debug"
|
|
depends on BLUETOOTH_RFCOMM
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
RFCOMM layer.
|
|
|
|
config BLUETOOTH_DEBUG_HFP_HF
|
|
bool "Bluetooth Hands Free Profile (HFP) debug"
|
|
depends on BLUETOOTH_HFP_HF
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Hands Free Profile (HFP).
|
|
|
|
config BLUETOOTH_DEBUG_AVDTP
|
|
bool "Bluetooth AVDTP debug"
|
|
depends on BLUETOOTH_AVDTP
|
|
help
|
|
This option enables debug support for the Bluetooth AVDTP.
|
|
|
|
config BLUETOOTH_DEBUG_A2DP
|
|
bool "Bluetooth A2DP debug"
|
|
depends on BLUETOOTH_A2DP
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
A2DP profile.
|
|
|
|
config BLUETOOTH_DEBUG_SDP
|
|
bool "Bluetooth Service Discovery Protocol (SDP) debug"
|
|
depends on BLUETOOTH_BREDR
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Service Discovery Protocol (SDP).
|
|
|
|
endif # BLUETOOTH_DEBUG
|
|
|
|
config BLUETOOTH_BREDR
|
|
bool "Bluetooth BR/EDR support [EXPERIMENTAL]"
|
|
depends on BLUETOOTH_HCI_HOST
|
|
select BLUETOOTH_PERIPHERAL
|
|
select BLUETOOTH_CENTRAL
|
|
select BLUETOOTH_SMP
|
|
select BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
|
|
help
|
|
This option enables Bluetooth BR/EDR support"
|
|
|
|
if BLUETOOTH_BREDR
|
|
config BLUETOOTH_RFCOMM
|
|
bool "Bluetooth RFCOMM protocol support [EXPERIMENTAL]"
|
|
help
|
|
This option enables Bluetooth RFCOMM support
|
|
|
|
config BLUETOOTH_RFCOMM_L2CAP_MTU
|
|
int "L2CAP MTU for RFCOMM frames"
|
|
default BLUETOOTH_RX_BUF_LEN
|
|
depends on BLUETOOTH_RFCOMM
|
|
range BLUETOOTH_RX_BUF_LEN 32767
|
|
help
|
|
Maximum size of L2CAP PDU for RFCOMM frames.
|
|
|
|
config BLUETOOTH_HFP_HF
|
|
bool "Bluetooth Handsfree profile HF Role support [EXPERIMENTAL]"
|
|
depends on PRINTK
|
|
select BLUETOOTH_RFCOMM
|
|
help
|
|
This option enables Bluetooth HF support
|
|
|
|
config BLUETOOTH_AVDTP
|
|
bool "Bluetooth AVDTP protocol support [EXPERIMENTAL]"
|
|
help
|
|
This option enables Bluetooth AVDTP support
|
|
|
|
config BLUETOOTH_A2DP
|
|
bool "Bluetooth A2DP Profile [EXPERIMENTAL]"
|
|
select BLUETOOTH_AVDTP
|
|
help
|
|
This option enables the A2DP profile
|
|
|
|
config BLUETOOTH_PAGE_TIMEOUT
|
|
hex "Bluetooth Page Timeout"
|
|
default 0x2000
|
|
range 0x0001 0xffff
|
|
help
|
|
This option sets the page timeout value. Value is selected as
|
|
(N * 0.625) ms.
|
|
|
|
config BLUETOOTH_BREDR_NAME
|
|
string "Bluetooth BR/EDR device name"
|
|
default "Zephyr"
|
|
help
|
|
Bluetooth BR/EDR name. Name can be up to 248 bytes long (excluding
|
|
NULL termination). Can be empty string.
|
|
endif # BLUETOOTH_BREDR
|