首页 > 解决方案 > Benchmarking connection time interval in Android across different phones

问题描述

Hello Android and Embedded devs community, I have a question related to BLE connection intervals. I am developing an efficient hardware prototype which relies on tight data transfer rate and I would like to be able to perform an adequate benchmark of the BLE connection parameters from the Android phone (since there are so many of them with such different hardware!).

Just to recall some easy concepts, taken from here.

A BLE connection interval is the time between two data transfer events (BLE connection events) between the central and the peripheral device. The theoretical value ranges from 7.5 ms to 4 secs (with increments of 1.25 ms).

The connection is established with the interval parameter value set by the master (central) device. However, the peripheral may suggest/request different values. The master still has the final say in the values and may end up choosing values different than but closer to the requested values.

The master in my system is the phone, hence the need for performing an adequate benchmark to test which phones will be able to work for the final user.

Is there a way on Android to perform this analysis and obtain the BLE connection parameters directly on the phone?

标签: androidbluetoothbluetooth-lowenergy

解决方案


我设法通过在我的 Android 应用程序上计时以下回调来解决这个问题:

@Override public void onCharacteristicChanged(BluetoothGatt gatt,BluetoothGattCharacteristic 
{
  /* Timing code measuring msecs between calls. */ 
}

这非常适合执行我正在寻找的基准。


推荐阅读