其他分享
首页 > 其他分享> > android – Google Nearby Connection API:测量信号强度

android – Google Nearby Connection API:测量信号强度

作者:互联网

最近我发现使用Google Nearby API在设备之间进行通信看起来很酷.通过文档略读没有回答我的问题 – 是否可以实时测量连接信号强度,或者我应该发明一些例如测量发送和接收数据的时间或其他什么?

谢谢.

解决方法:

作为在线程Google Nearby Messages – Cancel initial link between devices中声明的Nearby API的开发人员:

Today, Nearby doesn’t expose distance directly

他建议改用BLE RSII

You can get a rough approximation of distance by measuring BLE RSSI if one of the devices is capable of BLE advertising. This will be sensitive to how the device is held, antenna gain and environmental factors but better than random.

There’s not a straight-forward “tape measure” API, though.

标签:android,google-play-services,bluetooth-lowenergy,google-nearby
来源: https://codeday.me/bug/20190528/1169022.html