How to send a Bluefruit UART message that does not end with a null character

To send a Bluetooth Low Energy (BLE) UART message that does not end with a null character (i.e. "\0"), create a char* from your string and send the message using the bleuart.write function.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 10/24/2023 at 13:01
Last Updated on 10/24/2023 at 13:19
<p>Two flowers that represent Arduino and Bluetooth side by side. Beneath them sits the text "Bluefuit UART message without a null character."</p>

To send a Bluetooth Low Energy (BLE) UART message that does not end with a null character (i.e. "\0"), create a char* from your string and send the message using the bleuart.write function.

SubscribeDownload Open Source Project

The following project assumes that you have setup your Arduino project to work with an Adafruit nRF52 Bluefruit LE chip.

To learn how to set this up, consult the guide below.

Learn how to setup an Adafruit nRF52 Bluefruit LE to work with Arduino

After setting up the Adafruit nRF52 Bluefruit LE, you can send a message that ends with a null character use code similar to that below.

This code requires you to convert a string to a char array (char *), this can be done using the utility below.

As noted in the code above, this message breaks the default 20 byte Maximum Transmission Unit (MTU) and requires you to change the Bluefruit's MTU to allow for it.

To learn how to do this, consult the tutorial linked below.

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

Looking to send a UART message that terminates with a null character ?

To learn how to send a UART message using an Adafruit Bluefruit nRF52 LE that terminates with a null character, consult the tutorial below.

How to send a Bluefruit UART message that ends with a null character

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