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