蓝牙BLE readCharacteristic有一些错误
问题描述:
当我使用BLE阅读也有一些错误的时间特点,蓝牙BLE readCharacteristic有一些错误
错误如下:
java.lang.SecurityException: Need BLUETOOTH_PRIVILEGED permission: Neither user 10168 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
但我alredy添加适当的权限:
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
答
你的清单中有android.permission.BLUETOOTH_PRIVILEGED,但是你确定它被授予了吗?根据https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_PRIVILEGED“这是不可用于第三方应用程序”
+0
thanks.we已更改传输协议。 –
characteristic.getProperties()= 26我不是如何come.others平等6或10 –
只是一个想法:是这个特点保护,以便只有配对的设备可以访问它吗? – Christopher
我已配对设备。如果只有系统bluetooh可以访问它。 我们尝试使用HID来沟通 –