我遇到了BLE设备的问题 - 在设备被禁用后,Android BLE堆栈没有报告它的断开约15秒。正如我所看到的,超时时会出现实际断开事件。有没有办法通知android该设备消失了?我的应用程序代码非常标准,如下所示:
private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (newState == BluetoothProfile.STATE_CONNECTED) {
.....
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
// I placed breakpoint at this line and don't see any events for a long time.
}
}