Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
4 years, 8 months ago.
How/when exactly does mbed send data over the BLE connection?
I'm confused about where/when exactly data gets transferred over the BLE connection, perhaps someone could clarify for me:
If I had, for example, a program that polls & refreshes a battery level very quickly, say 100 times per second, and always "updates" the battery level value (100 times per second) using: batteryService->updateBatteryLevel(batteryLevel); (or similar update code) And then the program always yields to ble.waitForEvent() as required...
Where/how does mbed actually transfer the data? Does the function call "updateBatteryLevel" actually trigger data transfer over BLE? Or does it just update a value ready for the next scheduled transfer event set by the connection parameters (e.g connection interval).
Some follow-up questions: Will there be any issues in "updating" a BLE characteristic value like this at a much faster rate than the defined connection interval? If several different characteristic values are "updated" in this way in before the next connection interval how do I (or how does mbed) decide which ones to send first? Is there a risk of "overloading" the BLE and killing the connection if too many characteristic updates occur between connection intervals?
Any insightful advice on this is greatly appreciated!