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 -> {