@stoprocent/noble 1.13.3 → 1.13.5

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.
@@ -151,6 +151,7 @@ Hci.STATUS_MAPPER = STATUS_MAPPER;
151
151
  Hci.prototype.init = function (options) {
152
152
  this._socket.on('data', this.onSocketData.bind(this));
153
153
  this._socket.on('error', this.onSocketError.bind(this));
154
+ this._socket.on('state', this.pollIsDevUp.bind(this));
154
155
 
155
156
  if (this._userChannel) {
156
157
  this._socket.bindUser(this._deviceId, this._bindParams);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "license": "MIT",
7
7
  "name": "@stoprocent/noble",
8
8
  "description": "A Node.js BLE (Bluetooth Low Energy) central library.",
9
- "version": "1.13.3",
9
+ "version": "1.13.5",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/stoprocent/noble.git"
@@ -31,10 +31,10 @@
31
31
  "debug": "^4.3.4",
32
32
  "napi-thread-safe-callback": "^0.0.6",
33
33
  "node-addon-api": "^4.3.0",
34
- "node-gyp-build": "^4.5.0"
34
+ "node-gyp-build": "^4.6.1"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@stoprocent/bluetooth-hci-socket": "^1.1.4"
37
+ "@stoprocent/bluetooth-hci-socket": "^1.2.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@semantic-release/exec": "^6.0.3",
@@ -47,7 +47,7 @@
47
47
  "eslint-plugin-n": "^15.6.0",
48
48
  "eslint-plugin-promise": "^6.1.1",
49
49
  "mocha": "^10.2.0",
50
- "node-gyp": "^9.4.0",
50
+ "node-gyp": "^10.0.0",
51
51
  "nyc": "^15.1.0",
52
52
  "prebuildify": "^5.0.1",
53
53
  "prebuildify-cross": "5.0.0",
Binary file
Binary file
@@ -40,9 +40,10 @@ describe('hci-socket hci', () => {
40
40
  hci._userChannel = 'userChannel';
41
41
  hci.init();
42
42
 
43
- assert.callCount(hci._socket.on, 2);
43
+ assert.callCount(hci._socket.on, 3);
44
44
  assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
45
45
  assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
46
+ assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);
46
47
 
47
48
  assert.calledOnceWithExactly(hci._socket.bindUser, deviceId, undefined);
48
49
  assert.calledOnceWithExactly(hci._socket.start);
@@ -57,9 +58,10 @@ describe('hci-socket hci', () => {
57
58
  hci._bound = false;
58
59
  hci.init();
59
60
 
60
- assert.callCount(hci._socket.on, 2);
61
+ assert.callCount(hci._socket.on, 3);
61
62
  assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
62
63
  assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
64
+ assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);
63
65
 
64
66
  assert.calledOnceWithExactly(hci._socket.bindRaw, deviceId, undefined);
65
67
  assert.calledOnceWithExactly(hci._socket.start);
@@ -76,9 +78,10 @@ describe('hci-socket hci', () => {
76
78
  hci._bound = true;
77
79
  hci.init();
78
80
 
79
- assert.callCount(hci._socket.on, 2);
81
+ assert.callCount(hci._socket.on, 3);
80
82
  assert.calledWithMatch(hci._socket.on, 'data', sinon.match.func);
81
83
  assert.calledWithMatch(hci._socket.on, 'error', sinon.match.func);
84
+ assert.calledWithMatch(hci._socket.on, 'state', sinon.match.func);
82
85
 
83
86
  assert.notCalled(hci._socket.bindRaw);
84
87
  assert.calledOnceWithExactly(hci._socket.start);