From c4ae4589c6c001329ebb731589b209e8ddcbf7ca Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 24 三月 2026 16:03:59 +0800
Subject: [PATCH] 2026年03月24日16:03:57
---
app/src/main/java/com/hdl/photovoltaic/utils/BleWifiConfiguratorUtils.java | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/utils/BleWifiConfiguratorUtils.java b/app/src/main/java/com/hdl/photovoltaic/utils/BleWifiConfiguratorUtils.java
index 3de6a4a..da08be8 100644
--- a/app/src/main/java/com/hdl/photovoltaic/utils/BleWifiConfiguratorUtils.java
+++ b/app/src/main/java/com/hdl/photovoltaic/utils/BleWifiConfiguratorUtils.java
@@ -325,8 +325,8 @@
if (bluetoothGatt != null) {
bluetoothGatt.disconnect(); // 鍏堟柇寮�杩炴帴
-// bluetoothGatt.close();
-// bluetoothGatt = null;
+ bluetoothGatt.close();
+ bluetoothGatt = null;
Log.d(TAG, "Connecting to 鍏堟柇寮�鏃ц摑鐗欒繛鎺�");
}
BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(deviceAddress);
@@ -370,10 +370,10 @@
gatt.discoverServices();
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
isConnected = false;
- if (bluetoothGatt != null) {
- bluetoothGatt.close();
- bluetoothGatt = null;
- }
+// if (bluetoothGatt != null) {
+// bluetoothGatt.close();
+// bluetoothGatt = null;
+// }
if (connectListener != null) {
callbackHandler.post(() -> connectListener.onDisconnected());
}
@@ -429,7 +429,7 @@
}
return;
}
- Log.e(TAG, "onCharacteristicWrite: 鍐欏叆鎴愬姛鍥炲");
+ Log.d(TAG, "onCharacteristicWrite: 鍐欏叆鎴愬姛鍥炲");
if (characteristic.getUuid().equals(charUuid)) {
//鍐欏叆鎴愬姛
if (writeListener != null) {
@@ -441,7 +441,7 @@
@Override
public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
- Log.e(TAG, "onCharacteristicChanged: " + characteristic.getUuid());
+ Log.d(TAG, "onCharacteristicChanged: " + characteristic.getUuid());
//鏀跺埌钃濈墮鍥炲鐨勬暟
if (characteristic.getUuid().equals(notifyCharUuid) && writeListener != null) {
byte[] value = characteristic.getValue();
--
Gitblit v1.8.0