Commit d4bb47da authored by martin hou's avatar martin hou

fix: 忙时取消电池状态检测

parent 8b9ecdc7
...@@ -244,6 +244,10 @@ function Jensen(log, conn) { ...@@ -244,6 +244,10 @@ function Jensen(log, conn) {
return device; return device;
} }
this.busy = function() {
return Boolean(current);
}
this.setUSBDevice = function (dev) { this.setUSBDevice = function (dev) {
device = dev; device = dev;
ready = false; ready = false;
...@@ -1184,6 +1188,11 @@ Jensen.prototype.getFileBlock = async function (filename, length, ondata) { ...@@ -1184,6 +1188,11 @@ Jensen.prototype.getFileBlock = async function (filename, length, ondata) {
Jensen.prototype.getBatteryStatus = function(seconds) Jensen.prototype.getBatteryStatus = function(seconds)
{ {
if (this.model != 'hidock-p1') return null; if (this.model != 'hidock-p1') return null;
if (this.busy())
{
Logger.debug('jensen', 'dispatcher', 'cancel getBatteryStatus cuz busy');
return;
}
return this.send(new Command(GET_BATTERY_STATUS), seconds); return this.send(new Command(GET_BATTERY_STATUS), seconds);
} }
Jensen.prototype.writeSerialNumber = async function (sn) { Jensen.prototype.writeSerialNumber = async function (sn) {
......
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