I want to send many data to a device from my datafield using BLE. I use Characteristic.requestWrite() with writeType WRITE_TYPE_WITH_RESPONSE. I wait for callback BleDelegate.onCharacteristicWrite() to recall Characteristic.requestWrite(), and so on.
Note that if I call requestWrite() many times without waiting callback onCharacteristicWrite() then an exception is triggered by requestWrite().
Note that requestWrite() allows to write 20 bytes maximum (MTU).
I only log the current time (Toybox.System.getTimer()) before calling Characteristic.requestWrite(), my goal is to measure time between 2 BLE requests.
Here are my results on average time between 2 logs:
Simulator, fr265 : 60ms
Real device, Fenix5+ : 83ms
Real device, VivoActive5 : 220ms
By sniffing packets on real devices, I found following BLE connexion intervals:
Fenix5+ : 30ms
VivoActive5 : 90ms
When I set writeType to WRITE_TYPE_DEFAULT (without response), I have following results:
Simulator, fr265 : 3ms
Real device, Fenix5+ : 66ms
I would expect to have 2x less time on Fenix5+ when writing without response but that's not the result I get. Does the response implies a second connexion interval to come back?
Is there a way to send more than 20 bytes per BLE connexion interval? Or in other words, is there a way so send multiple BLE requests in parallel?