How to change the MTU of a nRF52 Bluefruit LE in Arduino

To change the Maximum Transmission Unit (MTU), use the Bluefruit's library configPrphBandwidth or configCentralBandwidth function along with a Bandwidth Enum.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 10/24/2023 at 11:16
Last Updated on 10/24/2023 at 13:01
<p>Two flowers that represent Arduino and Bluetooth side by side with the text "Set Bluefruit MTU" beneath them.</p>

To change the Maximum Transmission Unit (MTU), use the Bluefruit's library configPrphBandwidth or configCentralBandwidth function along with a Bandwidth Enum.

SubscribeDownload Open Source Starter Project

A nRF52 Bluefruit LE's MTU is set to 20 bytes by default, but can be expanded to a maximum of 247 bytes by calling the configPrphBandwidth and configCentralBandwidth function with a Bandwidth enum before calling the Bluefruit.begin() function.

The available bandwidth enums are:

  • BANDWIDTH_AUTO
  • BANDWIDTH_LOW
  • BANDWIDTH_NORMAL
  • BANDWIDTH_HIGH
  • BANDWIDTH_MAX

Consult the link below to see the these enums affect the Bluefruit's MTU.

Consult the code

Examples

To configure the nRF52 Bluefruit LE to act as a peripheral with a maximum of 247 bytes, call the function below before Bluefruit.begin().

Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);

To configure the nRF52 Bluefruit LE to act as a central manager with a maximum of 128 bytes, call the function below before Bluefruit.begin().

Bluefruit.configCentralBandwidth(BANDWIDTH_HIGH);

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe