java - 例外:蓝牙设备未准备好
问题描述
我的 Java 应用程序创建了一个蓝牙服务器并等待连接。我的程序在 Windows 中运行良好。但是当我尝试在 Linux 中运行它时会出现此错误。我该如何解决这个问题?
BlueCove version 2.1.1-SNAPSHOT on bluez
javax.bluetooth.BluetoothStateException: Bluetooth Device is not ready. [1] Operation not permitted
at com.intel.bluetooth.BluetoothStackBlueZ.nativeSetLocalDeviceDiscoverable(Native Method)
at com.intel.bluetooth.BluetoothStackBlueZ.setLocalDeviceDiscoverable(BluetoothStackBlueZ.java:307)
at javax.bluetooth.LocalDevice.setDiscoverable(LocalDevice.java:206)
at bluetoothjava.WaitThread.waitForConnection(WaitThread.java:32)
at bluetoothjava.WaitThread.run(WaitThread.java:18)
at java.base/java.lang.Thread.run(Thread.java:834)
BlueCove stack shutdown completed
解决方案
推荐阅读
- mysql - Mysql:如何将对象数组插入列中?
- php - 创建新数据时如何在现有表中创建新字段 Laravel
- c# - 检测任务计划程序何时终止控制台程序
- javascript - 使用 JS 获取页面的 URL
- react-native - TypeError: _this.props.route.params 不是函数...是 Object 的实例)
- firebase - Firebase 复杂查询定价
- javascript - Javascript:根据对象第一个索引值从对象数组中返回第一个副本
- javascript - 将排序转换为唯一排序
- excel - Office 365 ProPlus,是否支持 VBA Excel 宏?
- c# - Newtonsoft.Json 如何反序列化 json Key : Value to C# Property