@stoprocent/noble 2.3.0 → 2.3.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.
@@ -929,10 +929,15 @@ Hci.prototype.onSocketData = function (data) {
929
929
 
930
930
  Hci.prototype.onSocketError = function (error) {
931
931
  debug(`onSocketError: ${error.message}`);
932
-
933
- if (error.code === 'EPERM') {
932
+ // Handle Socket Error
933
+ if ('syscall' in error && error['syscall'] === 'socket creation failed') {
934
+ this.emit('stateChange', 'unsupported');
935
+ }
936
+ // Permisions
937
+ else if (error.code === 'EPERM') {
934
938
  this.emit('stateChange', 'unauthorized');
935
- } else if (error.message === 'Network is down') {
939
+ }
940
+ else if (error.message === 'Network is down') {
936
941
  // no-op
937
942
  }
938
943
  };
@@ -80,7 +80,7 @@ winrt::fire_and_forget RadioWatcher::OnRadioChanged() {
80
80
  capabilities.centralRoleSupported = adapter.IsCentralRoleSupported();
81
81
 
82
82
  Radio bluetooth = nullptr;
83
- if (radio.State() == RadioState::On && adapter.IsPeripheralRoleSupported()) {
83
+ if (radio.State() == RadioState::On && adapter.IsCentralRoleSupported()) {
84
84
  bluetooth = radio;
85
85
  }
86
86
 
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": "2.3.0",
9
+ "version": "2.3.2",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/stoprocent/noble.git"
@@ -33,7 +33,7 @@
33
33
  "node-gyp-build": "^4.8.1"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@stoprocent/bluetooth-hci-socket": "^2.2.1"
36
+ "@stoprocent/bluetooth-hci-socket": "^2.2.3"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/eslint-parser": "^7.27.0",