Skip to content

Commit 413efb4

Browse files
author
Daisuke Baba
committed
Merge branch 'release/2.0.4'
2 parents b323d27 + 0b23823 commit 413efb4

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
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.4
238+
- Fix an issue where this node don't work with [email protected]
239+
237240
* 2.0.3
238241
- Fix an issue where noble looses a reference to a peripheral after it is disconnected
239242

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-generic-ble",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "Node-RED nodes for generic BLE devices",
55
"license": "Apache-2.0",
66
"repository": {
@@ -59,7 +59,7 @@
5959
"supertest": "^1.1.0"
6060
},
6161
"dependencies": {
62-
"noble": "^1.8.1",
62+
"noble": "~1.8.1",
6363
"node-cache": "^4.1.0",
6464
"queue": "^4.2.1",
6565
"source-map-support": "^0.4.2"

src/generic-ble.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ function peripheralTask(uuid, task, done, RED, forceConnect=false) {
570570

571571
function tearDown(err) {
572572
if (TRACE) {
573-
RED.log.info(`<peripheralTask> <${uuid}> Trying to disconnect,${err}`);
573+
RED.log.info(`<peripheralTask> <${uuid}> Trying to disconnect,(err:${err})`);
574574
}
575575
disconnectPeripheral(peripheral, () => {
576576
if (TRACE) {
@@ -611,7 +611,7 @@ function addErrorListenerToQueue(RED) {
611611
q.removeAllListeners('error');
612612
q.on('error', (err) => {
613613
if (TRACE) {
614-
RED.log.error(`[GenericBLE] ${err} :: ${err.stack || 'N/A'}`);
614+
RED.log.error(`[GenericBLE] error:${err} :: ${err.stack || 'N/A'}`);
615615
}
616616
});
617617
}
@@ -865,7 +865,7 @@ export default function(RED) {
865865
if (this.genericBleNode) {
866866
this.genericBleNode.on('ble-read', (uuid, readObj, err) => {
867867
if (err) {
868-
this.error(`<${uuid}> read: ${err}`);
868+
this.error(`<${uuid}> read: (err:${err})`);
869869
return;
870870
}
871871
let payload = {
@@ -876,7 +876,7 @@ export default function(RED) {
876876
try {
877877
payload = JSON.stringify(payload);
878878
} catch(err) {
879-
this.warn(`<${uuid}> read: ${err}`);
879+
this.warn(`<${uuid}> read: (err:${err})`);
880880
return;
881881
}
882882
}
@@ -887,7 +887,7 @@ export default function(RED) {
887887
if (this.notification) {
888888
this.genericBleNode.on('ble-notify', (uuid, readObj, err) => {
889889
if (err) {
890-
this.error(`<${uuid}> notify: ${err}`);
890+
this.error(`<${uuid}> notify: (err:${err})`);
891891
return;
892892
}
893893
let payload = {
@@ -898,7 +898,7 @@ export default function(RED) {
898898
try {
899899
payload = JSON.stringify(payload);
900900
} catch(err) {
901-
this.warn(`<${uuid}> read: ${err}`);
901+
this.warn(`<${uuid}> notify: (err:${err})`);
902902
return;
903903
}
904904
}
@@ -959,7 +959,7 @@ export default function(RED) {
959959
if (this.genericBleNode) {
960960
this.genericBleNode.on('ble-write', (uuid, err) => {
961961
if (err) {
962-
this.error(`<${uuid}> write: ${err}`);
962+
this.error(`<${uuid}> write: (err:${err})`);
963963
return;
964964
}
965965
if (TRACE) {
@@ -1063,10 +1063,10 @@ export default function(RED) {
10631063
};
10641064
schedulePeripheralTask(peripheral.uuid, task, (err) => {
10651065
if (TRACE) {
1066-
RED.log.info(`/__bledev/${address} END err:${err}`);
1066+
RED.log.info(`/__bledev/${address} END (err:${err})`);
10671067
}
10681068
if (err) {
1069-
RED.log.error(`/__bledev/${address} ${err}\n=>${err.stack || err.message}`);
1069+
RED.log.error(`/__bledev/${address} err:${err}\n=>${err.stack || err.message}`);
10701070
if (!res._headerSent) {
10711071
return res.status(500).send({ status: 500, message: (err.message || err) }).end();
10721072
}

0 commit comments

Comments
 (0)