From c86ef81c4ab2419303e7a9d595e2bddc261c48e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=8F=81?= Date: Fri, 27 Dec 2024 15:13:46 +0800 Subject: [PATCH] feat: disconnect --- .../java/icu/fur93/esp32_car/repository/BluetoothRepository.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/icu/fur93/esp32_car/repository/BluetoothRepository.kt b/app/src/main/java/icu/fur93/esp32_car/repository/BluetoothRepository.kt index 6b730e4..6bcb280 100644 --- a/app/src/main/java/icu/fur93/esp32_car/repository/BluetoothRepository.kt +++ b/app/src/main/java/icu/fur93/esp32_car/repository/BluetoothRepository.kt @@ -143,12 +143,13 @@ class BluetoothRepositoryImpl( status: Int, newState: Int ) { + Log.d("onConnectionStateChange", "status: $status, newState: $newState") + if (status != BluetoothGatt.GATT_SUCCESS) { scope.launch(Dispatchers.Main) { Toast.makeText(context, "连接失败,错误码: $status", Toast.LENGTH_SHORT) .show() } - return } when (newState) { BluetoothProfile.STATE_CONNECTED -> {