I am using Blob Request to read an attribute which is more than 23 Bytes. My application's MTU is 23.I could see in the sniffer that, to transfer 512 bytes, it is taking 24 internal blob requests with incremental offset of 22, server sends me the data back. It is taking around 105 ms for each internal Blob request in my case and with LightBlue app as central. I am not much aware of this internal fragmentation by Android BLE. Could someone confirm me if that 105ms for each internal request and 2.5 seconds to read 512 bytes is due to internal mechanism?
CodePudding user response:
Sounds reasonable. I guess you have not updated the connection interval and hence use the default of ~52 ms. I also guess your remote device is not optimized to be able to respond with a Read Blob Response in the same connection event (which must be done within 150 microseconds). Therefore every transaction will take two connection events and you end up with 105 ms. Consider increasing the MTU, switching to notifications or switching to L2CAP CoC to get higher throughput, as well as use the LE Data Length extension. Otherwise just lower the connection interval to increase the number of transactions per second you can perform.
CodePudding user response:
The timing you observe depends on a number of factors, so your observation is only one of many possibilities. It could just as well be a little faster but also a lot slower.
Since the Bluetooth radio is a shared resource, other applications can also access it at the same time. The radio on the receiver side may also have other things to do and thus change the time delay. And last but not least, there is usually also a dependency on 2.4 GHz WLAN so that, for example, a data transmission taking place there at the same time also has an influence on the transmission speed.