Commit 483d8a2b authored by martin hou's avatar martin hou

fix: 过滤掉名字长度为0的设备

parent 69c13e32
......@@ -1567,6 +1567,7 @@ Jensen.registerHandler(BLUETOOTH_SCAN, (msg, jensen) => {
let m = (msg.body[k++] & 0xff).toString(16).toUpperCase();
mac.push(m.length == 1 ? '0' + m : m);
}
if (len == 0) continue;
devices.push({
name: decoder.decode(jensen.truncateIncompleteUtf8(sname)),
mac: mac.join('-')
......@@ -1687,6 +1688,7 @@ Jensen.registerHandler(BT_DEV_LIST, (msg, jensen) => {
let rssi = msg.body[k++] & 0xff;
let cod = ((msg.body[k++] & 0xff) << 16) | ((msg.body[k++] & 0xff) << 8) | (msg.body[k++] & 0xff);
let isAudio = __is_headset_or_mic(cod);
if (len == 0) continue;
devices.push({
name: (isAudio ? '🎧' : '🚫') + decoder.decode(jensen.truncateIncompleteUtf8(sname)),
mac: mac.join('-'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment