Arm Mbed OS support forum

Best way send large packets over BLE

Hello,

I am working on a project for which I need to communicate with a mobile app.

The board will be logging information on certain events into a flash memory which should be retrieved by the mobile app every once in a while (potentially a few KB).

The board also will need to be configured with some parameters like S/N.

I would love to have something similar to a socket in which I could design my own protocol but the closest thing I saw to this is the UARTService and it is deprecated.

Which is the best alternative?

Hi Lluis

this forum is primarily for questions about mbed-os rather than general programming questions so I’m not sure you will find your answers here.

Regards
Anna

Maybe @AnnaBridge misread your question.

I think that this page should give you direction on what is possible at the BLE GAP level: https://os.mbed.com/docs/mbed-os/v6.4/apis/gap.html

Then look at GattServer examples as this provides a more generic approach than the deprecated UARTService example.

Hello @AnnaBridge,

Thank you for your comment.

My question was more about why UARTService has been deprecated in Mbed OS and whether there is an official alternative as I couldn’t find any by looking at the documentation.

Anyway, it looks like I have found a solution to my problem.

Hi @gerriko,

Thank you for your comment.

Indeed this is the solution I am testing right now. I took the GattServer demo as a baseline and I am testing the following approach, which seems to work:

  • Read “countCharacteristic” to know number of logs.
  • Subscribe to notification from “logCharacteristic”.
  • Write index to “requestLogsCharacteristic” to ask the device to start “streaming” the logs starting from index.
  • Receive the data via notifications through the “logCharacteristic”.

For S/N, etc it is very straightforward just by using BLE the way it is meant to.