如何找到在Android的蓝牙配对失败的原因? [英] How to find the reason for Bluetooth pairing failure in Android?
问题描述
我尝试配对使用蓝牙的设备。有时配对工作正常。但是,有时 createBond()
函数返回false。如何找到失败的原因是什么?
如果(!device.createBond()){ //要找到失败的原因}
已经绑定的设备上调用createBond()时,这种消极的结果可以引起的。请记住,保税并不意味着连接,保税用于配对即可。检查你的设备的蓝牙设置已经为您试图连接到该设备的已知配置。如果是这样,删除蓝牙配置,然后做createBond将解决这个问题。
I'm trying to pair a device using Bluetooth. Sometimes pairing is working fine. but, sometimes createBond()
function returns false. How to find the reason for the failure?
if(!device.createBond()){
// want to find the reason for the failure
}
This negative result can be caused when calling createBond() on an already bonded device. Remember that bonded does not mean connected, bonded means paired. Check if your device bluetooth settings already has a known configuration for the device you are trying to connect to. If so, deleting the Bluetooth configuration and then doing createBond will fix the problem.
这篇关于如何找到在Android的蓝牙配对失败的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!