【问题标题】:BlueCove cannot connect do Device "Permission Denied [13]"BlueCove 无法连接做设备“权限被拒绝 [13]”
【发布时间】:2021-11-08 14:31:57
【问题描述】:

我正在尝试连接蓝牙设备,在将目标设备设置为配对模式时可以配对,但尝试使用以下方法重新连接会导致错误。 导致它的代码:

StreamConnection streamConnection = null;
        try {
            streamConnection = (StreamConnection)Connector.open("btspp://A0E6F8FECB26:1;authenticate=false;encrypt=false;master=false");
            callback.onSocketCreated(streamConnection);
            callback.onConnectionSucceed();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

发生的异常

java.io.IOException: Failed to connect. [13] Permission denied
at com.intel.bluetooth.BluetoothStackBlueZ.connectionRfOpenClientConnectionImpl(Native Method)
at com.intel.bluetooth.BluetoothStackBlueZ.connectionRfOpenClientConnection(BluetoothStackBlueZ.java:574)
at com.intel.bluetooth.BluetoothRFCommClientConnection.<init>(BluetoothRFCommClientConnection.java:37)
at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:379)
at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
at javax.microedition.io.Connector.open(Connector.java:83)
at insight.utils.ConnectionEstablisher.run(ConnectionEstablisher.java:170)

我必须使用 Java,这是我发现的唯一一个库(这有点工作):

BlueCove version 2.1.1-SNAPSHOT on bluez

我在 Arch Linux 上使用最新的 bluez 版本,我已经尝试过 This Fix 无济于事。

感谢任何帮助

【问题讨论】:

    标签: java exception bluetooth bluecove


    【解决方案1】:

    所以本质上,问题在于整个蓝牙堆栈/它如何将“配对请求”传播到蓝牙堆栈。

    作为旁注,我在 Arch Linux 上使用 BlueZ (5.56) 和用于 Java 的 bluecove 库。

    我正在寻找替代蓝牙堆栈并考虑在不使用 BlueZ 堆栈的 Windows 10 上尝试相同的代码。

    然后Windows 会弹出一个窗口,询问我是否要与此设备配对。

    这是 Windows 和 Linux 之间的主要区别。 Windows / 它的蓝牙堆栈或任何负责它的东西,实际上将设备注册为“配对”。

    这让我可以重新连接到设备,而不会出现任何“权限被拒绝”问题。

    希望这可以帮助任何必须处理这个库或有类似问题的人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      • 2017-11-03
      • 1970-01-01
      • 1970-01-01
      • 2014-08-10
      • 2018-07-19
      • 2016-09-01
      相关资源
      最近更新 更多