FastBle icon indicating copy to clipboard operation
FastBle copied to clipboard

Auto connect is not working even though the autoconnect is true

Open Pruthvirajcodewave opened this issue 5 years ago • 2 comments

Auto conenction is not happening even though the autoconnect is true ? Any ways to do it in this ?

Pruthvirajcodewave avatar Dec 06 '19 14:12 Pruthvirajcodewave

Hi Pruthviraj, You can comment disconnect(); and closeBluetoothGatt(); method in BleBluetooth class. because we need to keep open the ble gatt to do auto connect or reconnect. It is work for me. code: case BleMsg.MSG_DISCONNECTED: { lastState = LastState.CONNECT_DISCONNECT; BleManager.getInstance().getMultipleBluetoothController().removeBleBluetooth(BleBluetooth.this); isActiveDisconnect = true; // disconnect(); refreshDeviceCache(); //closeBluetoothGatt(); removeRssiCallback(); removeMtuChangedCallback(); clearCharacterCallback(); mainHandler.removeCallbacksAndMessages(null); BleConnectStateParameter para = (BleConnectStateParameter) msg.obj; boolean isActive = para.isActive(); int status = para.getStatus(); if (bleGattCallback != null) bleGattCallback.onDisConnected(isActive, bleDevice, bluetoothGatt, status); } break;

kaleesz avatar Jan 22 '20 06:01 kaleesz

same here

fr0zenrain avatar Jun 06 '21 03:06 fr0zenrain