Skip to content

Commit

Permalink
- Fixed jshint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
petersaints authored and rzr committed Oct 3, 2020
1 parent 36608aa commit 519bafd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/hci-socket/hci.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Hci.prototype.resetBuffers = function() {
this._handleAclsInProgress = {};
this._handleBuffers = {};
this._aclOutQueue = [];
}
};

Hci.prototype.pollIsDevUp = function() {
var isDevUp = this._socket.isDevUp();
Expand Down Expand Up @@ -146,7 +146,7 @@ Hci.prototype.initDev = function() {
this.readLeHostSupported();
this.readBdAddr();
this.leReadBufferSize();
}
};

Hci.prototype.setSocketFilter = function() {
var filter = new Buffer(14);
Expand Down Expand Up @@ -467,14 +467,14 @@ Hci.prototype.pushAclOutQueue = function() {
debug("\tin progress = " + inProgress);
debug("\twaiting = " + this._aclOutQueue.length);
}
}
};

Hci.prototype.writeOneAclDataPkt = function() {
var pkt = this._aclOutQueue.shift();
this._handleAclsInProgress[pkt.handle]++;
debug('write acl data pkt frag ' + pkt.fragId + ' handle ' + pkt.handle + ' - writing: ' + pkt.pkt.toString('hex'));
this._socket.write(pkt.pkt);
}
};

Hci.prototype.onSocketData = function(data) {
debug('onSocketData: ' + data.toString('hex'));
Expand Down Expand Up @@ -550,22 +550,22 @@ Hci.prototype.onSocketData = function(data) {
this.processLeMetaEvent(leMetaEventType, leMetaEventStatus, leMetaEventData);
} else if (subEventType === EVT_NUMBER_OF_COMPLETED_PACKETS) {
var handles = data.readUInt8(3);
for (var i = 0; i < handles; i++) {
var handle = data.readUInt16LE(4 + i * 4);
var pkts = data.readUInt16LE(6 + i * 4);
debug("\thandle = " + handle);
for (var j = 0; j < handles; j++) {
var handle_ = data.readUInt16LE(4 + j * 4);
var pkts = data.readUInt16LE(6 + j * 4);
debug("\thandle = " + handle_);
debug("\t\tcompleted = " + pkts);
if (this._handleAclsInProgress[handle] === undefined) {
if (this._handleAclsInProgress[handle_] === undefined) {
debug("\t\talready closed");
continue;
}
if (pkts > this._handleAclsInProgress[handle]) {
if (pkts > this._handleAclsInProgress[handle_]) {
// Linux kernel may send acl packets by itself, so be ready for underflow
this._handleAclsInProgress[handle] = 0;
this._handleAclsInProgress[handle_] = 0;
} else {
this._handleAclsInProgress[handle] -= pkts;
this._handleAclsInProgress[handle_] -= pkts;
}
debug("\t\tin progress = " + this._handleAclsInProgress[handle]);
debug("\t\tin progress = " + this._handleAclsInProgress[handle_]);
}
this.pushAclOutQueue();
}
Expand Down Expand Up @@ -712,7 +712,7 @@ Hci.prototype.processLeReadBufferSize = function(result) {
this._aclMtu = aclMtu;
this._aclMaxInProgress = aclMaxInProgress;
}
}
};

Hci.prototype.processLeMetaEvent = function(eventType, status, data) {
if (eventType === EVT_LE_CONN_COMPLETE) {
Expand Down

0 comments on commit 519bafd

Please sign in to comment.