我的应用程序在连接到 BLE 设备时遇到问题。在应用程序进行的每次连接尝试中,它都会在 OnConnectionStateChange() 方法中获得错误代码 0x0006(不支持请求)。我已尝试关闭/打开蓝牙,但仍然出现相同的错误。
我在 LG D410(Android 5.0.2)中遇到了这个问题。在我将 LG 手机升级到 5.0.2 后,应用开始出现此错误。我的应用在三星 Galaxy S4(Android 5.1)、Nexus 5(Android 6.0)上运行良好。
为什么我会收到此错误?可以做些什么来修复它?
以下是错误日志:
02-26 05:30:53.919 D/MyBluetoothClass-1392940(21607): trying to connect with address: 78:A5:04:86:D4:16
02-26 05:30:53.944 D/MyBluetoothClass-1392940(21607): Create a new GATT connection.
02-26 05:30:53.945 D/BluetoothGatt(21607): connect() - device: 78:A5:04:86:D4:16, auto: true
02-26 05:30:53.945 D/BluetoothGatt(21607): registerApp()
02-26 05:30:53.945 D/BluetoothGatt(21607): registerApp() - UUID=a81c9b62-f822-4e42-9af0-752a8eab82a1
02-26 05:30:53.947 D/BluetoothGatt(21607): onClientRegistered() - status=0 clientIf=5
02-26 05:30:53.947 D/MyBluetoothClass-1392940(21607): Connection attempt started; results reported asynchronously
02-26 05:30:53.947 D/BluetoothGatt(21607): refresh() - device: 78:A5:04:86:D4:16
02-26 05:30:53.950 D/BluetoothGatt(21607): onClientConnectionState() - status=6 clientIf=5 device=78:A5:04:86:D4:16
02-26 05:30:53.951 D/MyBTGattCallback(21607): onConnectionStateChange, newState: 0
02-26 05:30:53.951 E/MyBTGattCallback(21607): onConnectionStateChange status 0006 desc Req not supported