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

nRF52840 best / simplest BLE service for data transfer

Hi All.

I have a DK52 project where a peripheral advertises and connects to a central nRF52840 ok. I based it on the multilink_central demo, so have the LED button service setup at the moment.

However it seems like a pretty complicated service just to basically send the state of the push button. I attempted to modify it so I can send big packets of data, but thought there must be a service better suited that I can modify instead?

What would be the best service in the examples to use / base a service on for the following;

1 - Send large arrays/packets of bytes from peripheral to central (max that can be sent in one message) to get best through put.

2 - Send some basic status information both ways.

Thanks

Phil

  • Hi Phil,

    I hope this will help.  My device with the nRF51822 is receiving data from a smart phone and putting it into an array, and it is further processed internally with the Arm processor in the nRF51822.  There should be similar example code for the nRF52840.  Note though, I am only receiving BLE data, not transmitting.  Cheers, Brian

    https://devzone.nordicsemi.com/f/nordic-q-a/37984/load-received-ble-data-into-an-array

  • Send large arrays/packets of bytes

    What do you mean by, "large" ?

    Note that BLE is not really designed for high-volume data ...

    What would be the best service in the examples to use

    Look at the Nordic UART Service (NUS).

    It's called "UART" because, like a UART, it can be used to send arbitrary amounts of arbitrary data - not because it has anything specifically to do with the hardware UART!

  • Thanks for the responses, ill take a look at the UART service. 

    By large packets I should have said about 100 Kbps. From what I have read that should be possible over BLE, just need to find the best service for that.

  • By large packets I should have said about 100 Kbps

    Err ... that's a speed - not a size!

    Beware that achievable throughput may be limited by the Host; eg, Android/iOS...

  • Sorry yes I know that's not a size, I should have stated a data rate right at the start rather than packet size, as max packet size is obviously negligible compared to the amount of data going through.

    Host is a nRF52840 acting as a ble central, so should be ok hopefully.

    I have had a tinker with the UART service a bit, that looks perfect. Fairly easy to understand compared with the button service I was originally looking at.

    Thanks all for your help pointing me in that direction.