Commit eb2facdd authored by martin hou's avatar martin hou

fix: 删除蓝牙设备列表写入指令

parent c5620057
......@@ -283,9 +283,6 @@ declare class Jensen {
// 获取蓝牙设备列表
getScanResults: (seconds?: number) => Promise<BluetoothDevice[]>;
// 写入蓝牙设备列表
writeBluetoothDeviceList: (mac_list: string[], seconds?: number) => Promise<ReturnStruct['common']>;
// 获取已配对的蓝牙设备列表
getPairedDevices: (seconds?: number) => Promise<BluetoothDevice[]>;
......
......@@ -1604,21 +1604,7 @@ Jensen.registerHandler(READ_WEBUSB_TIMEOUT, (msg) => {
return { timeout: timeout };
});
// 写入蓝牙设备列表
Jensen.prototype.writeBluetoothDeviceList = async function (mac_list, seconds) {
if (this.model.indexOf('hidock-p1') == -1) return null;
let data = [];
for (let i = 0; i < mac_list.length; i++) {
let mac = mac_list[i];
let marr = mac.split(':');
if (marr.length != 6) throw new Error('invalid mac');
for (let j = 0; j < marr.length; j++) data.push(parseInt(marr[j], 16));
}
return this.send(new Command(BT_WRITE_DEV_LIST).body(data), seconds);
};
Jensen.registerHandler(BT_SCAN, commonMessageParser);
Jensen.registerHandler(BT_WRITE_DEV_LIST, commonMessageParser);
Jensen.registerHandler(BT_DEV_LIST, (msg) => {
// console.log('bluetooth-scan', msg);
if (msg.body.length == 0) return [];
......
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