Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: bluetooth: GATT large MTU/throughput example #25648

Closed
JordanYates opened this issue May 27, 2020 · 3 comments
Closed

samples: bluetooth: GATT large MTU/throughput example #25648

JordanYates opened this issue May 27, 2020 · 3 comments
Assignees
Labels
area: Bluetooth Host area: Bluetooth Enhancement Changes/Updates/Additions to existing features

Comments

@JordanYates
Copy link
Collaborator

JordanYates commented May 27, 2020

Is your enhancement proposal related to a problem? Please describe.
There are currently no in-tree examples of the Kconfig options and code flow required to setup a GATT connection to use a larger MTU than the default.

Given the multiple Kconfig namespaces that these options cross, a single reference example would be appreciated.

An example of the confusions and open questions from #25561.
CONFIG_BT_ACL_RX_COUNT needs to be increased from its default value of 1. CONFIG_BT_CTLR_RX_BUFFERS, which sets the default value of CONFIG_BT_ACL_RX_COUNT should however not be incremented. Do CONFIG_BT_L2CAP_TX_MTU and CONFIG_BT_L2CAP_RX_MTU need to increased? One of these depends on CONFIG_BT_HCI_ACL_FLOW_CONTROL, which should not be enabled.

Describe the solution you'd like
A variant of the samples/bluetooth/central application that additionally increases the MTU of the connection to the largest values supported by the GATT client.

The proj.conf would contain the minimal configs necessary to achieve this.

Describe alternatives you've considered
Improved documentation under:
https://docs.zephyrproject.org/latest/guides/bluetooth/bluetooth-dev.html
or
https://docs.zephyrproject.org/latest/reference/bluetooth/gatt.html
Would also be an alternative.

Additional context

The Nordic NCS repository has a GATT throughput example that does increase the MTU.
This example uses Nordics custom BT controller, which means the proj.conf is not valid for the combined controller/host builds that are the default for Zephyr.
https://github.com/nrfconnect/sdk-nrf/tree/master/samples/bluetooth/throughput

@JordanYates JordanYates added the Enhancement Changes/Updates/Additions to existing features label May 27, 2020
@JordanYates JordanYates changed the title doc: Bluetooth GATT large MTU example doc: Bluetooth GATT large MTU sample May 27, 2020
@JordanYates JordanYates changed the title doc: Bluetooth GATT large MTU sample samples: Bluetooth GATT large MTU example May 27, 2020
@JordanYates JordanYates changed the title samples: Bluetooth GATT large MTU example samples: bluetooth: GATT large MTU example May 27, 2020
@carlescufi carlescufi changed the title samples: bluetooth: GATT large MTU example samples: bluetooth: GATT large MTU/throughput example Feb 4, 2021
@JordanYates
Copy link
Collaborator Author

# Uncoded LE Data Packet Format:
#
# | Preamble | Access  |                           PDU (2 to 257 bytes)                         |   CRC   |
# |          | Address | LL Header |       Link Layer PDU (0 to 251 bytes)           |    MIC   |         |
# |          |         |           | L2CAP Header |      L2CAP PDU (0-247 bytes)     | Optional |         |
# |          |         |           |              |    ATT Header    |  ATT Payload  |          |         |
# |          |         |           |              | OpCode | Handle  |               |          |         |
# |  1 byte  | 4 bytes |  2 bytes  |   4 bytes    | 1 byte | 2 bytes | 0 - 244 bytes | 4 bytes  | 3 bytes |
#
# L2CAP can be larger than 247 bytes, but will be split across multiple LL packets as a result.
# ATT payloads can be larger than 244 bytes, but will be split across multiple LL packets as a result.
# 
#
# Kconfig Symbols:
#     CONFIG_BT_CTLR_DATA_LENGTH_MAX : Maximum payload size of the Link Layer PDU
#     CONFIG_BT_BUF_ACL_TX_SIZE      : Maximum L2CAP PDU is limited to this value - 4
#     CONFIG_BT_BUF_ACL_RX_SIZE      : Maximum L2CAP PDU is limited to this value - 4
#     CONFIG_BT_L2CAP_TX_MTU         : Maximum L2CAP PDU size for transmission

In the meantime, here is documentation I made for others struggling with configuring this

@theob-pro
Copy link
Contributor

Hi @JordanYates, do you think that the newly added sample is enough? We would like to get your feedback to know if we should improve it or if we could close this issue.

@JordanYates
Copy link
Collaborator Author

Looks to be enough, and if there are problems with it that should be its own issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host area: Bluetooth Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

5 participants