This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending a NULL character in BLE UART example

In the ble app uart example, I need the BLE device to be able to send out a null character. I noticed when I receive a message with a null character at the end from the UART device, it does not get sent out over BLE. Our application uses a protocol with a checksum embedded into it. The checksum is always the last character in the message. Sometimes the checksum happens to be a null character. I can see from setting breakpoints in the code that the message is received properly in the uart_event_handle function. However, when ble_nus_data_send is called, the BLE device does not send out the last character in the data array if it is a null character.

Parents
  • The Nordic UART Service (NUS) can certainly send arbitrary binary data - all byte values from 0x00 to 0xFF

    Are you using one of the SDK examples?

    They assume that the UART is connected to a terminal, with a person typing manually at that terminal - so are probably filtering out "non-printing" characters.

    Remember, also, that NUL is the string terminator in C - so you won't be able to use any standard C str...() functions.

Reply
  • The Nordic UART Service (NUS) can certainly send arbitrary binary data - all byte values from 0x00 to 0xFF

    Are you using one of the SDK examples?

    They assume that the UART is connected to a terminal, with a person typing manually at that terminal - so are probably filtering out "non-printing" characters.

    Remember, also, that NUL is the string terminator in C - so you won't be able to use any standard C str...() functions.

Children
No Data
Related