forked from yudi_xiao/expo-ble-app-demo
expo-ble模块测试demo 联调BLE模块 take 11 新增log 前4 个frame 包
This commit is contained in:
parent
83cdf722ac
commit
5678b22b5e
|
|
@ -169,6 +169,8 @@ export class BleProtocolService {
|
||||||
console.debug(`Sending ${total} frames`);
|
console.debug(`Sending ${total} frames`);
|
||||||
for (let i = 0; i < total; i++) {
|
for (let i = 0; i < total; i++) {
|
||||||
const frame = frames[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(' '));
|
||||||
console.debug(`Writing frame ${i + 1}/${total}, length = ${frame.length}`);
|
console.debug(`Writing frame ${i + 1}/${total}, length = ${frame.length}`);
|
||||||
const base64 = Buffer.from(frame).toString('base64');
|
const base64 = Buffer.from(frame).toString('base64');
|
||||||
const result = await this.client.write(deviceId, BLE_UUIDS.SERVICE, BLE_UUIDS.WRITE_CHARACTERISTIC, base64, false);
|
const result = await this.client.write(deviceId, BLE_UUIDS.SERVICE, BLE_UUIDS.WRITE_CHARACTERISTIC, base64, false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue