expo-ble模块测试demo 联调BLE模块 take 12 减少无用的log

This commit is contained in:
Yudi Xiao
2025-12-11 17:26:06 +08:00
parent 5678b22b5e
commit eab4d172e6
2 changed files with 10 additions and 7 deletions

View File

@@ -169,8 +169,10 @@ export class BleProtocolService {
console.debug(`Sending ${total} frames`);
for (let i = 0; i < total; i++) {
const frame = frames[i];
if (i < 5)
console.debug("raw frame \n", Array.from(frame).map(b => b.toString(16).padStart(2, '0')).join(' '));
if (i < 3) {
const rawFrame = Array.from(frame).map(b => b.toString(16).padStart(2, '0')).join(' ')
console.debug(`raw ${i + 1} frame \n ${rawFrame}`);
}
console.debug(`Writing frame ${i + 1}/${total}, length = ${frame.length}`);
const base64 = Buffer.from(frame).toString('base64');
const result = await this.client.write(deviceId, BLE_UUIDS.SERVICE, BLE_UUIDS.WRITE_CHARACTERISTIC, base64, false);