今天在用Kotlin写一个蓝牙发送的app时,出现有连接蓝牙失败,打印错误代码显示为133,使用的库为ECBLE.kt,在里面加入下需的代码
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
bluetoothGatt = item.bluetoothDevice.connectGatt(bleContext, false, bluetoothGattCallback, TRANSPORT_LE); //
} else {
bluetoothGatt = item.bluetoothDevice.connectGatt(bleContext, false, bluetoothGattCallback);
}