简体   繁体   English

是否可以确定/识别 BLE 设备何时将断开连接

[英]Is it possible to determine/identify when BLE device is about to disconnect


I have a BLE device (self made) that I pair with my app (iOS+Android).我有一个与我的应用程序(iOS+Android)配对的BLE设备(自制)。
I want to notify the user when the bluetooth signal is weak or better - when the device is about to disconnect.我想在蓝牙信号较弱或更好时通知用户 - 当设备即将断开连接时。

Searching the web resulted with RSSI being the only value that is related to signal, yet I was unable to find a RSSI threshold that hints possible disconnection.搜索 web 结果发现 RSSI 是唯一与信号相关的值,但我无法找到暗示可能断开连接的 RSSI 阈值。

Is there a way to know?有没有办法知道?

Thanks a lot, Giora.非常感谢,乔拉。

The ability to connect to a BLE device with weak RSSI varies a lot depending on the phone you're using to connect to your device.连接到 RSSI 较弱的 BLE 设备的能力因您用于连接设备的手机而异。

With some smartphones, especially those running on Android 8+, you might be able to stay connected to a BLE device advertising with a weak RSSI, whereas with some other smartphone, you're might have issue staying connected to a device with a strong RSSI.对于某些智能手机,尤其是在 Android 8+ 上运行的智能手机,您可能能够保持连接到具有弱 RSSI 的 BLE 设备广告,而对于其他一些智能手机,您可能无法保持连接到具有强 RSSI 的设备.

It also depends on the quality of the BLE chip on your peripheral.它还取决于外围设备上 BLE 芯片的质量。

To answer your question, I would say you need to run some calibration tests, establishing the average RSSI at which your center or peripheral throws a disconnection, and start from there.要回答您的问题,我想说您需要运行一些校准测试,确定您的中心或外围设备断开连接的平均 RSSI,然后从那里开始。

You'll need to calculate this average across several types of phones, including Android and iOS's, or, even better, set a threshold per OS.您需要计算几种手机的平均值,包括 Android 和 iOS,或者更好的是,为每个操作系统设置一个阈值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM