zephyr/subsys/bluetooth/services/ots/Kconfig

135 lines
3.7 KiB
Text
Raw Normal View History

# Bluetooth Object Transfer service
# Copyright (c) 2020-2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BT_OTS
bool "Object Transfer Service (OTS) [EXPERIMENTAL]"
select BT_L2CAP_DYNAMIC_CHANNEL
select BT_GATT_DYNAMIC_DB
select BT_SMP
select EXPERIMENTAL
help
Enable Object Transfer Service.
if BT_OTS
config BT_OTS_DIR_LIST_OBJ
bool "The Directory Listing Object"
help
Enables the Directory Listing Object, which is an object that contains all the metadata
from all other objects, for easy exposure to a client. Enabling this will use one of the
objects given by BT_OTS_MAX_OBJ_CNT.
config BT_OTS_DIR_LIST_OBJ_NAME
string "The object name of the Directory Listing Object"
default "Directory"
depends on BT_OTS_DIR_LIST_OBJ
help
The name of the Directory Listing Object when it is read by a client.
config BT_OTS_MAX_INST_CNT
int "Maximum number of available OTS instances"
default 1
range 1 1 if !BT_OTS_SECONDARY_SVC
config BT_OTS_SECONDARY_SVC
bool "Register OTS as Secondary Service"
config BT_OTS_OACP_CREATE_SUPPORT
bool "Support OACP Create Operation"
depends on BT_OTS_OACP_WRITE_SUPPORT
depends on BT_OTS_OBJ_NAME_WRITE_SUPPORT
config BT_OTS_OACP_CHECKSUM_SUPPORT
bool "Support OACP Calculate Checksum operation"
config BT_OTS_OACP_DELETE_SUPPORT
bool "Support OACP Delete Operation"
config BT_OTS_OACP_READ_SUPPORT
bool "Support OACP Read Operation"
default y
config BT_OTS_OACP_WRITE_SUPPORT
bool "Support OACP Write Operation"
config BT_OTS_OACP_PATCH_SUPPORT
bool "Support patching of objects"
depends on BT_OTS_OACP_WRITE_SUPPORT
config BT_OTS_OLCP_GO_TO_SUPPORT
bool "Support OLCP Go To Operation"
default y
config BT_OTS_OBJ_NAME_WRITE_SUPPORT
bool "Support object name write"
endif # BT_OTS
#### Object Transfer Service Client ################################
config BT_OTS_CLIENT
bool "Object Transfer Service Client [Experimental]"
select BT_L2CAP_DYNAMIC_CHANNEL
select BT_GATT_CLIENT
select BT_GATT_AUTO_DISCOVER_CCC
select EXPERIMENTAL
help
This option enables support for the Object Transfer Service Client.
if BT_OTS_CLIENT
# TODO: Unify logging for OTS server and client - the client uses
# "BT" debugging, the server does not.
config BT_DEBUG_OTS_CLIENT
bool "Object Transfer Service Client debug"
select DEPRECATED
help
Use this option to enable Object Transfer Client debug logs
module = BT_OTS_CLIENT
legacy-debug-sym = BT_DEBUG_OTS_CLIENT
module-str = "Object Transfer Service Client"
source "subsys/bluetooth/common/Kconfig.template.log_config_bt"
endif # BT_OTS_CLIENT
if BT_OTS || BT_OTS_CLIENT
config BT_OTS_MAX_OBJ_CNT
hex "Maximum number of objects that each service instance can store"
default 0x05
# Given the maximum size of a directory listing record (172) and the maximum size of an
# object using the net_buf implementation is 2^16-1, the maximum number of objects is given
# by 2^16-1 / 172 = 381 == 0x17D)
range 0x02 0x17D if BT_OTS_DIR_LIST_OBJ
# Max obj count is otherwise the non-RFU IDs available
range 0x01 0xFFFFFFFFFFFFFEFF
config BT_OTS_L2CAP_CHAN_TX_MTU
int "Size of TX MTU for Object Transfer Channel"
default 256
range 21 65533
config BT_OTS_L2CAP_CHAN_RX_MTU
int "Size of RX MTU for Object Transfer Channel"
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-04-27 10:38:23 +02:00
# RX MTU will be truncated to account for the L2CAP PDU and SDU header.
default BT_BUF_ACL_RX_SIZE
range 21 BT_BUF_ACL_RX_SIZE
config BT_OTS_OBJ_MAX_NAME_LEN
int "Maximum object name length"
# Max name length allowed by OTS spec is 120 octets
# TODO: Set separate max name length for client, as other
# servers may use the full 120 octets.
default 120
range 1 120
module = BT_OTS
module-str = BT_OTS
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
endif # BT_OTS || BT_OTS_CLIENT