Android-BluetoothKit icon indicating copy to clipboard operation
Android-BluetoothKit copied to clipboard

临时解决通讯notify接收不能超过20个字节问题

Open loveanao opened this issue 3 years ago • 2 comments

修改源码 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);
}

loveanao avatar May 31 '22 15:05 loveanao

老哥,方便加下联系方式吗?请教你蓝牙开发的问题

code-rebooter avatar Sep 05 '22 07:09 code-rebooter

如果是用经典蓝牙,使用这个库是不是很多地方需要调整 关键的收发数据

tomKitty888888 avatar Jul 07 '23 08:07 tomKitty888888