Android-BluetoothKit
Android-BluetoothKit copied to clipboard
临时解决通讯notify接收不能超过20个字节问题
修改源码 BluetoothGattResponse
@Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
// 为了接受超过20个字节的数据
// 前提条件: 第一 设备支持蓝牙4.2协议规范,第二 android 5.0
// mut 一般限制范围为23~517字节
if (gatt != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int mut = 96;
gatt.requestMtu(mut);
}
response.onConnectionStateChange(status, newState);
}
老哥,方便加下联系方式吗?请教你蓝牙开发的问题
如果是用经典蓝牙,使用这个库是不是很多地方需要调整 关键的收发数据