From 50f143ead56176a67ad8cabaf4de364bf1828118 Mon Sep 17 00:00:00 2001 From: petersaints Date: Sun, 30 Dec 2018 20:56:01 +0000 Subject: [PATCH 1/6] - Renamed to @abandonware/bleno - Updated Package Dependecies --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3d8d1fd6..cdede85f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "bleno", - "version": "0.5.0", + "name": "@abandonware/bleno", + "version": "0.5.1-0", "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", "main": "index.js", "engines": { @@ -35,13 +35,13 @@ "license": "MIT", "readmeFilename": "README.md", "devDependencies": { - "jshint": "~2.9.4", - "should": "~2.0.2", - "mocha": "~1.14.0", - "node-blink1": "~0.2.2" + "jshint": "~2.9.7", + "should": "~13.2.3", + "mocha": "~5.2.0", + "node-blink1": "~0.2.3" }, "dependencies": { - "debug": "^2.2.0" + "debug": "^4.1.1" }, "optionalDependencies": { "bluetooth-hci-socket": "^0.5.1", From bc76e7784a0ead55c9492ab33c2e56659f92b8f3 Mon Sep 17 00:00:00 2001 From: petersaints Date: Tue, 5 Mar 2019 13:28:46 +0000 Subject: [PATCH 2/6] - Package Updates (mocha & jshint) - Converted to a private package so that it can easily be used as local package with npm link without messing up with "npm update" and "npm outdated" commands.+- --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cdede85f..7cabdc86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@abandonware/bleno", "version": "0.5.1-0", + "private": true, "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", "main": "index.js", "engines": { @@ -35,10 +36,10 @@ "license": "MIT", "readmeFilename": "README.md", "devDependencies": { - "jshint": "~2.9.7", - "should": "~13.2.3", - "mocha": "~5.2.0", - "node-blink1": "~0.2.3" + "jshint": "^2.10.1", + "mocha": "^6.0.2", + "node-blink1": "~0.2.3", + "should": "~13.2.3" }, "dependencies": { "debug": "^4.1.1" From 2c75192f5488d913e098a951565ef392da08181e Mon Sep 17 00:00:00 2001 From: petersaints Date: Tue, 5 Mar 2019 13:43:26 +0000 Subject: [PATCH 3/6] - Fixed jshint errors --- lib/hci-socket/hci.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/hci-socket/hci.js b/lib/hci-socket/hci.js index 6a8a509b..565c8a00 100644 --- a/lib/hci-socket/hci.js +++ b/lib/hci-socket/hci.js @@ -118,7 +118,7 @@ Hci.prototype.resetBuffers = function() { this._handleAclsInProgress = {}; this._handleBuffers = {}; this._aclOutQueue = []; -} +}; Hci.prototype.pollIsDevUp = function() { var isDevUp = this._socket.isDevUp(); @@ -146,7 +146,7 @@ Hci.prototype.initDev = function() { this.readLeHostSupported(); this.readBdAddr(); this.leReadBufferSize(); -} +}; Hci.prototype.setSocketFilter = function() { var filter = new Buffer(14); @@ -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')); @@ -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(); } @@ -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) { From ea88c93b6e1f90ee9f2137c35dca9a0ec9e84bf4 Mon Sep 17 00:00:00 2001 From: petersaints Date: Sun, 30 Dec 2018 20:56:01 +0000 Subject: [PATCH 4/6] - Renamed to @abandonware/bleno - Updated Package Dependecies --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e5955ac5..f2f59c7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "bleno", - "version": "0.5.0", + "name": "@abandonware/bleno", + "version": "0.5.1-0", "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", "main": "index.js", "engines": { @@ -35,13 +35,13 @@ "license": "MIT", "readmeFilename": "README.md", "devDependencies": { - "jshint": "~2.9.4", + "jshint": "~2.9.7", "should": "~13.2.3", "mocha": "~5.2.0", - "node-blink1": "~0.2.2" + "node-blink1": "~0.2.3" }, "dependencies": { - "debug": "^4.1.0" + "debug": "^4.1.1" }, "optionalDependencies": { "@abandonware/bluetooth-hci-socket": "^0.5.3-1", From 3299d9be4a369774aa94cedef9829fab3e04f04f Mon Sep 17 00:00:00 2001 From: petersaints Date: Tue, 5 Mar 2019 13:28:46 +0000 Subject: [PATCH 5/6] - Package Updates (mocha & jshint) - Converted to a private package so that it can easily be used as local package with npm link without messing up with "npm update" and "npm outdated" commands.+- --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f2f59c7d..b6db4439 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@abandonware/bleno", "version": "0.5.1-0", + "private": true, "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", "main": "index.js", "engines": { @@ -35,10 +36,10 @@ "license": "MIT", "readmeFilename": "README.md", "devDependencies": { - "jshint": "~2.9.7", - "should": "~13.2.3", - "mocha": "~5.2.0", - "node-blink1": "~0.2.3" + "jshint": "^2.10.1", + "mocha": "^6.0.2", + "node-blink1": "~0.2.3", + "should": "~13.2.3" }, "dependencies": { "debug": "^4.1.1" From f36d468d42b1fc531256788609035e2b39ed9396 Mon Sep 17 00:00:00 2001 From: petersaints Date: Tue, 5 Mar 2019 13:43:26 +0000 Subject: [PATCH 6/6] - Fixed jshint errors --- lib/hci-socket/hci.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/hci-socket/hci.js b/lib/hci-socket/hci.js index 83cbf6e4..855af21f 100644 --- a/lib/hci-socket/hci.js +++ b/lib/hci-socket/hci.js @@ -118,7 +118,7 @@ Hci.prototype.resetBuffers = function() { this._handleAclsInProgress = {}; this._handleBuffers = {}; this._aclOutQueue = []; -} +}; Hci.prototype.pollIsDevUp = function() { var isDevUp = this._socket.isDevUp(); @@ -146,7 +146,7 @@ Hci.prototype.initDev = function() { this.readLeHostSupported(); this.readBdAddr(); this.leReadBufferSize(); -} +}; Hci.prototype.setSocketFilter = function() { var filter = new Buffer(14); @@ -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')); @@ -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(); } @@ -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) {