Report
3 years, 2 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!

So it seems that the mBed / nRF51822 BLE automatically transfers data at a pre-defined rate (according to connection interval parameters set by the central device) and "updating" the characteristic value faster than this just means that it only sends whatever value was set for the particular moment of data transfer. NOTE: I'm running the mBed hardware as peripheral so it has limited ability to specify connection interval parameters.

It doesn't seem possible to "overload" the BLE API with too frequent updates to one characteristic. What happens when multiple characteristics are updated quickly I don't know yet.

posted by CJ Shaw 04 Jul 2016
Comment on this question
Be the first to answer this question.

You need to log in to post a question