From f8161657795a4f6c3626976b7cac17f06e81c334 Mon Sep 17 00:00:00 2001 From: Yudi Xiao <463708580@qq.com> Date: Thu, 11 Dec 2025 13:56:44 +0800 Subject: [PATCH] =?UTF-8?q?expo-ble=E6=A8=A1=E5=9D=97=E6=B5=8B=E8=AF=95dem?= =?UTF-8?q?o=20=E8=81=94=E8=B0=83BLE=E6=A8=A1=E5=9D=97=20take=209=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B1=BB=E5=9E=8B=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ble/services/BleProtocolService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ble/services/BleProtocolService.ts b/ble/services/BleProtocolService.ts index 679e039..1fb2014 100644 --- a/ble/services/BleProtocolService.ts +++ b/ble/services/BleProtocolService.ts @@ -139,10 +139,12 @@ export class BleProtocolService { } } - public async send(deviceId: string, type: COMMAND_TYPES, data: object | ArrayBuffer, onProgress?: (progress: number) => void): Promise { + public async send(deviceId: string, type: COMMAND_TYPES, data: object | ArrayBuffer | Uint8Array, onProgress?: (progress: number) => void): Promise { let payload: Uint8Array; if (data instanceof ArrayBuffer) { payload = new Uint8Array(data); + } else if (data instanceof Uint8Array) { + payload = data; } else { const jsonStr = JSON.stringify(data); payload = new Uint8Array(Buffer.from(jsonStr));