android - 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?
解决方案
我设法通过在我的 Android 应用程序上计时以下回调来解决这个问题:
@Override public void onCharacteristicChanged(BluetoothGatt gatt,BluetoothGattCharacteristic
{
/* Timing code measuring msecs between calls. */
}
这非常适合执行我正在寻找的基准。
推荐阅读
- vue.js - 如何使用 v-show 切换隐藏 div 中的第二行跨度?
- android-livedata - 使用视图模型和实时数据的双向绑定 - 错误“找不到符号类 ActivityLoginBindingImpl”
- gradle - Intellij + wsl2 + gradle 项目 => 项目视图中没有 src 文件夹
- c# - AddHandler 到 FrameworkElementFactory ComboBox - 类型错误?
- c# - 如何在使用 System.Linq.Dynamic.Core 构建表达式时检查 null
- java - 如何进行 Spring Data Elastic Search 集成测试
- jupyter-notebook - 如何修复 Jupyter Notebook 上的“'tar' 不是内部或外部命令、可运行程序或批处理文件”?
- python - 使用某些函数循环遍历 Pandas 的有效方法
- r - 为什么要在 rmarkdown pdf 中自定义输出 pdf 的路径?
- reactjs - ReferenceField 不工作反应管理员