Commit 43f24edb authored by martin hou's avatar martin hou

hidock-p1:mini增加对蓝牙命令的支持

parent 48571810
......@@ -586,12 +586,12 @@ Jensen.prototype.restoreFactorySettings = async function (seconds) {
};
Jensen.prototype.scanDevices = async function (seconds) {
if (this.model != 'hidock-p1') return null;
if (this.model.indexOf('hidock-p1') == -1) return null;
return this.send(new Command(BLUETOOTH_SCAN), seconds || 20);
};
Jensen.prototype.connectBTDevice = async function (mac, seconds) {
if (this.model != 'hidock-p1') return null;
if (this.model.indexOf('hidock-p1') == -1) return null;
let marr = mac.split('-');
if (marr.length != 6) throw new Error('invalid mac');
let addr = [];
......@@ -600,12 +600,12 @@ Jensen.prototype.connectBTDevice = async function (mac, seconds) {
};
Jensen.prototype.disconnectBTDevice = async function (seconds) {
if (this.model != 'hidock-p1') return null;
if (this.model.indexOf('hidock-p1') == -1) return null;
return this.send(new Command(BLUETOOTH_CMD).body([0x01]), seconds);
};
Jensen.prototype.getBluetoothStatus = async function (seconds) {
if (this.model != 'hidock-p1') return null;
if (this.model.indexOf('hidock-p1') == -1) return null;
return this.send(new Command(BLUETOOTH_STATUS), seconds);
};
......
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