@stoprocent/bleno 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,7 +133,6 @@ class Hci extends EventEmitter {
133
133
  }
134
134
 
135
135
  resetBuffers () {
136
- this._mainHandle = null;
137
136
  this._handleAclsInProgress = {};
138
137
  this._handleBuffers = {};
139
138
  this._aclOutQueue = [];
@@ -527,7 +526,7 @@ class Hci extends EventEmitter {
527
526
  if (subEventType === EVT_DISCONN_COMPLETE) {
528
527
  handle = data.readUInt16LE(4);
529
528
  debug('\t\thandle = ' + handle);
530
- if (handle !== this._mainHandle) {
529
+ if (this._handleAclsInProgress[handle] === undefined) {
531
530
  debug('\tignoring event because handle is unknown to bleno.');
532
531
  debug('This might be OK in a multi role scenario in which the handle is part of a noble connection.');
533
532
  return;
@@ -543,7 +542,6 @@ class Hci extends EventEmitter {
543
542
  Controller for the returned Handle have been flushed, and that the
544
543
  corresponding data buffers have been freed. */
545
544
  delete this._handleAclsInProgress[handle];
546
- this._mainHandle = null;
547
545
  const aclOutQueue = [];
548
546
  let discarded = 0;
549
547
  for (const i in this._aclOutQueue) {
@@ -789,7 +787,6 @@ class Hci extends EventEmitter {
789
787
  debug('\t\t\tsupervision timeout = ' + supervisionTimeout);
790
788
  debug('\t\t\tmaster clock accuracy = ' + masterClockAccuracy);
791
789
 
792
- this._mainHandle = handle;
793
790
  this._handleAclsInProgress[handle] = 0;
794
791
 
795
792
  this.emit('leConnComplete', status, handle, role, addressType, address, interval, latency, supervisionTimeout, masterClockAccuracy);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoprocent/bleno",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "lint": "eslint \"**/*.js\"",
20
20
  "lint-fix": "eslint \"**/*.js\" --fix",
21
21
  "prebuildify": "prebuildify --napi --target 14.0.0 --force --strip --verbose",
22
- "prebuildify-cross": "prebuildify-cross --napi --target 14.0.0 --force --strip --verbose",
22
+ "prebuildify-cross": "patch-package && prebuildify-cross --napi --target 14.0.0 --force --strip --verbose",
23
23
  "semantic-release": "semantic-release",
24
24
  "pretest": "npm run rebuild",
25
25
  "rebuild": "node-gyp rebuild",
@@ -65,11 +65,12 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "debug": "^4.4.0",
68
+ "patch-package": "^8.0.0",
68
69
  "node-addon-api": "^8.3.1",
69
70
  "node-gyp-build": "^4.8.4"
70
71
  },
71
72
  "optionalDependencies": {
72
- "@stoprocent/bluetooth-hci-socket": "^2.2.3"
73
+ "@stoprocent/bluetooth-hci-socket": "^2.2.5"
73
74
  },
74
75
  "publishConfig": {
75
76
  "access": "public"
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/@thegecko/docker-run/index.js b/node_modules/@thegecko/docker-run/index.js
2
+ index 5299bee..4de15b3 100644
3
+ --- a/node_modules/@thegecko/docker-run/index.js
4
+ +++ b/node_modules/@thegecko/docker-run/index.js
5
+ @@ -14,7 +14,7 @@ var endsWith = function(str, suffix) {
6
+ var run = function(image, opts) {
7
+ if (!opts) opts = {}
8
+
9
+ - var request = docker({host: opts.host, version: opts.version || 'v1.21'})
10
+ + var request = docker({host: opts.host, version: opts.version || 'v1.44'})
11
+ var that = new events.EventEmitter()
12
+ var tty = !!opts.tty
13
+
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/@vweevers/docker-pull/index.js b/node_modules/@vweevers/docker-pull/index.js
2
+ index 67b3e73..5fcb567 100644
3
+ --- a/node_modules/@vweevers/docker-pull/index.js
4
+ +++ b/node_modules/@vweevers/docker-pull/index.js
5
+ @@ -12,7 +12,7 @@ var pull = function (image, opts, cb) {
6
+ image = parse(image)
7
+ if (!image) throw new Error('Invalid image')
8
+
9
+ - var request = docker({host: opts.host, version: opts.version || 'v1.21'})
10
+ + var request = docker({host: opts.host, version: opts.version || 'v1.44'})
11
+ var that = new events.EventEmitter()
12
+ var layers = {}
13
+ var progress = {}
@@ -0,0 +1,30 @@
1
+ diff --git a/node_modules/prebuildify-cross/guest.js b/node_modules/prebuildify-cross/guest.js
2
+ index dfd9eb7..6d284fb 100644
3
+ --- a/node_modules/prebuildify-cross/guest.js
4
+ +++ b/node_modules/prebuildify-cross/guest.js
5
+ @@ -9,19 +9,15 @@ const cwd = '/home/node/app'
6
+ const files = JSON.parse(process.env.PREBUILDIFY_CROSS_FILES)
7
+ const argv = process.argv.slice(2)
8
+
9
+ -// Copy host files to working directory
10
+ -for (const file of files) {
11
+ - const a = path.join('/input', file)
12
+ - const b = path.join(cwd, file)
13
+ +// Recursively copy all input files to working directory
14
+ +fs.cpSync('/input', cwd, { recursive: true })
15
+
16
+ - fs.mkdirSync(path.dirname(b), { recursive: true })
17
+ - fs.copyFileSync(a, b, fs.constants.COPYFILE_EXCL)
18
+ - fs.chmodSync(b, 0o644)
19
+ +// Clean build directory if it exists to ensure fresh build
20
+ +const buildDir = path.join(cwd, 'build')
21
+ +if (fs.existsSync(buildDir)) {
22
+ + fs.rmSync(buildDir, { recursive: true, force: true })
23
+ }
24
+
25
+ -// Use node_modules of host to avoid a second install step
26
+ -fs.symlinkSync('/input/node_modules', path.join(cwd, 'node_modules'))
27
+ -
28
+ const stdio = ['ignore', 2, 2]
29
+ const res = cp.spawnSync('npx', ['--no-install', 'prebuildify', ...argv], { cwd, stdio })
30
+