From ca1b9b4377e487b36a0bb9543d4b75f6b2c93a7d Mon Sep 17 00:00:00 2001 From: Guoguo Date: Wed, 24 Jun 2026 04:10:58 -0700 Subject: [PATCH] debug: log FFE1 command hex on every writeRawCommand --- miniprogram/services/ble/commands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miniprogram/services/ble/commands.js b/miniprogram/services/ble/commands.js index 79c947d..3a41d25 100644 --- a/miniprogram/services/ble/commands.js +++ b/miniprogram/services/ble/commands.js @@ -72,6 +72,7 @@ function writeRawCommand(bytes) { reject({ error_code: 0xFF, error_msg: 'command characteristic not found' }) return } + console.log('[BLE] FFE1 发送', bytes.length + '字节', '| hex:', protocol.bytesToHex(bytes)) wx.writeBLECharacteristicValue({ deviceId: connection.getDeviceId(), serviceId: chars.command.serviceId, @@ -80,7 +81,8 @@ function writeRawCommand(bytes) { success: function () { resolve({ message: 'success', bytes: bytes }) }, - fail: function () { + fail: function (err) { + console.error('[BLE] FFE1 发送失败', err) reject({ error_code: 0x0C, error_msg: 'ERR_BLE_DISCONNECTED' }) } })