@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.
- package/examples/peripheral-explorer-async.js +2 -0
- package/lib/hci-socket/bindings.js +2 -1
- package/lib/hci-socket/gatt.js +2 -2
- package/lib/win/src/ble_manager.cc +2 -2
- package/lib/win/src/noble_winrt.cc +1 -1
- package/package.json +4 -3
- package/prebuilds/darwin-x64+arm64/@stoprocent+noble.node +0 -0
- package/prebuilds/win32-ia32/@stoprocent+noble.node +0 -0
- package/prebuilds/win32-x64/@stoprocent+noble.node +0 -0
|
@@ -336,7 +336,8 @@ NobleBindings.prototype.onLeConnComplete = function (
|
|
|
336
336
|
addressType,
|
|
337
337
|
address
|
|
338
338
|
);
|
|
339
|
-
const
|
|
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;
|
package/lib/hci-socket/gatt.js
CHANGED
|
@@ -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&
|
|
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() &&
|
|
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&
|
|
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.
|
|
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": "^
|
|
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": "^
|
|
63
|
+
"semantic-release": "^25.0.3",
|
|
63
64
|
"should": "^13.2.3",
|
|
64
65
|
"sinon": "^15.0.1"
|
|
65
66
|
},
|
|
Binary file
|
|
Binary file
|
|
Binary file
|