Skip to content

Commit 663d515

Browse files
author
Daisuke Baba
committed
Merge branch 'release/2.0.3'
2 parents 06dbefe + a042bf9 commit 663d515

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ Set `GENERIC_BLE_TRACE=true` on starting Node-RED and you can find the precise l
234234

235235
# Revision History
236236

237+
* 2.0.3
238+
- Fix an issue where noble looses a reference to a peripheral after it is disconnected
239+
237240
* 2.0.2
238241
- Fix an issue where Write operation cannot be performed properly (#4)
239242

examples/01-read-write.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"type": "Generic BLE",
145145
"z": "",
146146
"localName": "CC2650 SensorTag",
147-
"address": "54:6c:0e:78:86:80",
147+
"address": "88:99:00:00:FF:FF",
148148
"uuid": "666e850ba45c4952b8bed27a8133ecb2",
149149
"muteNotifyEvents": true,
150150
"operationTimeout": "5000",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-generic-ble",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Node-RED nodes for generic BLE devices",
55
"license": "Apache-2.0",
66
"repository": {

src/generic-ble.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ function disconnectPeripheral(peripheral, done, RED) {
396396
if (bleDevice) {
397397
bleDevice.emit('disconnected');
398398
}
399+
noble.stopScanning();
400+
noble.startScanning([], true);
399401
}
400402
timeout = null;
401403
if (done) {
@@ -411,6 +413,8 @@ function disconnectPeripheral(peripheral, done, RED) {
411413
if (bleDevice) {
412414
bleDevice.emit('timeout');
413415
}
416+
noble.stopScanning();
417+
noble.startScanning([], true);
414418
if (done) {
415419
done();
416420
}

0 commit comments

Comments
 (0)