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

Oscar de la Hera Gomez
Two flowers that represent Arduino and Bluetooth side by side with the text "Set Bluefruit MTU" beneath them.

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

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.

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.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details