BLE connect时候,返回的status总是133。
查了一下很多说资源释放问题。
我遇到的是因为安卓版本问题,缺少了参数
对于connect加上下面这段好就好了。
原文了连接
蓝牙BLE(BlueTooth BLE)入门及爬坑指南_碎火流荧的博客-程序员信息网_蓝牙ble - 程序员信息网
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
mBluetoothGatt = bluetoothDevice.connectGatt(MainActivity.this,
true, gattCallback, TRANSPORT_LE);
} else {
mBluetoothGatt = bluetoothDevice.connectGatt(MainActivity.this,
true, gattCallback);
}