简体   繁体   English

无法将设备与Android蓝牙配对

[英]Not able to pair device to Android Bluetooth

I am trying to pair TI CC2564 module with Android (5.0) and Android (6.0). 我正在尝试将TI CC2564模块与Android(5.0)和Android(6.0)配对。

5.0 : It never connects through the device settings. 5.0 :从不通过设备设置进行连接。 But I can use it from my app with call to function createRfcommSocket . 但是我可以在我的应用程序中通过调用函数createRfcommSocket使用它。 Issue here is that I need to connect the device manually every time I reopen the app. 这里的问题是,每次我重新打开应用程序时,我都需要手动连接设备。

6.0 : I am able to pair the device through device settings occasionally and it is hit and miss. 6.0 :我偶尔可以通过设备设置来配对设备,因此很容易碰到。 Once I pair the device it works flawlessly in the app. 配对设备后,它就可以在应用程序中完美运行。 But if I remove the pairing and try to pair again it doesn't allow me to pair with the following error in Logcat Device is not allowed because it is either insecure or of unknown security and needs user confirmation 但是,如果我删除了配对并尝试再次配对,则不允许我与Logcat Device is not allowed because it is either insecure or of unknown security and needs user confirmation的以下错误进行配对, Device is not allowed because it is either insecure or of unknown security and needs user confirmation

Any suggestion regarding how to get the device pair? 关于如何获得设备对的任何建议?

I was able to resolve the issue. 我能够解决问题。 The Bluetooth module's broadcast name is null by default, giving it a proper name allows the connection to succeed flawlessly. 蓝牙模块的广播名称默认情况下为null ,为其提供适当的名称可以使连接顺利进行。 I am guessing there is some issue with either Android or CC2564 BT stack, which might be causing a crash and hence disconnecting. 我猜想Android或CC2564 BT堆栈存在一些问题,可能会导致崩溃并因此断开连接。

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

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