优化100j

This commit is contained in:
微微一笑
2026-03-26 19:20:52 +08:00
parent e7b40dbed6
commit b99ac04c88
8 changed files with 745 additions and 120 deletions

View File

@ -38,11 +38,10 @@ class BleHelper {
if (linkedDevices && linkedDevices.length && linkedDevices.length > 0) {
// console.log("111111", linkedDevices);
linkedDevices = linkedDevices.filter((v) => {
if (v) {
v.Linked = false;
v.notifyState = false;
}
return v.device ? true : false;
if (!v) return false;
v.Linked = false;
v.notifyState = false;
return !!v.device;
});
}

View File

@ -49,6 +49,19 @@ class BleReceive {
ReceiveData(receive, f, path, recArr) {
// 100J首页等场景 LinkedList 项可能未带齐 mac/device但语音分片上传依赖 parseBleData 消费 FB 05
const sid = receive && receive.serviceId ? String(receive.serviceId) : '';
const is100JAe30 = /ae30/i.test(sid);
const fReady = f && f.macAddress && f.device && f.device.id;
if (is100JAe30 && receive && receive.bytes && receive.bytes.length >= 3 && !fReady) {
try {
parseBleData(new Uint8Array(receive.bytes));
} catch (e) {
console.warn('[100J] ReceiveData 兜底解析失败', e);
}
return receive;
}
if (f && f.macAddress && f.device && f.device.id) {
let handler = null;
let keys = Object.keys(this.HandlerMap);
@ -73,7 +86,10 @@ class BleReceive {
}
} else {
console.log("已收到该消息,但无法处理", receive, "f:", f);
// 100J AE30 二进制帧在 f 不完整时已在上方 parseBleData此处不再误报「无法处理」
if (!is100JAe30) {
console.log("已收到该消息,但无法处理", receive, "f:", f);
}
}
return receive;

View File

@ -445,7 +445,8 @@ export default {
});
},
(error) => {
console.log('文件不存在/路径错误:', error.message); // 核心问题!
console.log('文件不存在/路径错误:', error.message);
reject(error || new Error('resolveLocalFileSystemURL 失败'));
}
);
});