@stoprocent/noble 2.3.18 → 2.4.1

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.
@@ -79,6 +79,8 @@ noble.on('discover', async (peripheral) => {
79
79
  console.log();
80
80
 
81
81
  await explore(peripheral);
82
+ } else {
83
+ console.log(`Peripheral with ID ${peripheral.id} and name ${peripheral.advertisement?.localName} ignored`);
82
84
  }
83
85
  });
84
86
 
@@ -336,7 +336,8 @@ NobleBindings.prototype.onLeConnComplete = function (
336
336
  addressType,
337
337
  address
338
338
  );
339
- const gatt = new Gatt(address, aclStream);
339
+ const connectionParams = this._connectionQueue.length > 0 ? this._connectionQueue[0].params : {};
340
+ const gatt = new Gatt(address, aclStream, connectionParams && connectionParams.mtu);
340
341
  const signaling = new Signaling(handle, aclStream);
341
342
 
342
343
  this._gatts[uuid] = this._gatts[handle] = gatt;
@@ -56,7 +56,7 @@ const GATT_SERVER_CHARAC_CFG_UUID = 0x2903;
56
56
  const ATT_CID = 0x0004;
57
57
  /* eslint-enable no-unused-vars */
58
58
 
59
- const Gatt = function (address, aclStream) {
59
+ const Gatt = function (address, aclStream, desiredMtu) {
60
60
  this._address = address;
61
61
  this._aclStream = aclStream;
62
62
 
@@ -68,7 +68,7 @@ const Gatt = function (address, aclStream) {
68
68
  this._commandQueue = [];
69
69
 
70
70
  this._mtu = 23;
71
- this._desired_mtu = 256;
71
+ this._desired_mtu = desiredMtu || 256;
72
72
  this._security = 'low';
73
73
 
74
74
  this.onAclStreamDataBinded = this.onAclStreamData.bind(this);
@@ -290,7 +290,7 @@ bool BLEManager::Connect(const std::string& uuid)
290
290
 
291
291
  // Add to device map
292
292
  mDeviceMap.emplace(std::make_pair(uuid, std::move(peripheral)));
293
- } catch (const std::exception& e) {
293
+ } catch (const std::exception&) {
294
294
  mEmit.Connected(uuid, "invalid device address format");
295
295
  return false;
296
296
  }
@@ -413,7 +413,7 @@ void BLEManager::OnConnectionStatusChanged(BluetoothLEDevice device,
413
413
  return;
414
414
  }
415
415
  PeripheralWinrt& peripheral = mDeviceMap[uuid];
416
- if(peripheral.device.has_value() && &(peripheral.device.value()) == &device )
416
+ if (peripheral.device.has_value() && peripheral.device.value() == device)
417
417
  {
418
418
  peripheral.Disconnect();
419
419
  mNotifyMap.Remove(uuid);
@@ -277,7 +277,7 @@ Napi::Value NobleWinrt::AddressToId(const Napi::CallbackInfo& info)
277
277
  }
278
278
 
279
279
  return Napi::String::New(info.Env(), cleanUuid.c_str());
280
- } catch (const std::exception& e) {
280
+ } catch (const std::exception&) {
281
281
  return info.Env().Null();
282
282
  }
283
283
  }
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.18",
9
+ "version": "2.4.1",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/stoprocent/noble.git"
@@ -43,7 +43,8 @@
43
43
  "@semantic-release/changelog": "^6.0.3",
44
44
  "@semantic-release/exec": "^6.0.3",
45
45
  "@semantic-release/git": "^10.0.1",
46
- "@semantic-release/github": "^10.1.1",
46
+ "@semantic-release/github": "^12.0.6",
47
+ "@semantic-release/npm": "^13.1.5",
47
48
  "async": "^3.2.6",
48
49
  "cross-env": "^7.0.3",
49
50
  "eslint": "^8.57.1",
@@ -59,7 +60,7 @@
59
60
  "prebuildify-cross": "^5.1.1",
60
61
  "prettier": "^3.3.3",
61
62
  "proxyquire": "^2.1.3",
62
- "semantic-release": "^24.1.1",
63
+ "semantic-release": "^25.0.3",
63
64
  "should": "^13.2.3",
64
65
  "sinon": "^15.0.1"
65
66
  },