Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/4.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Aug 30, 2017
2 parents 1e4e60c + 0a7f1b8 commit e0c48e1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The following nodes are no longer included:

## サンプルフロー

BLEIo向けのサンプルフロー[`example-flow.json`](https://github.com/CANDY-LINE/node-red-contrib-asakusa_giken/blob/develop/src/exmple-flow.json) が利用可能です。クリックして中身を表示してから全体をコピーし、Node-REDの`Import`から`Clipboard`を選択して内容を貼り付けてください。
BLEIo向けのサンプルフロー[`example-flow.json`](https://github.com/CANDY-LINE/node-red-contrib-asakusa_giken/blob/develop/src/example-flow.json) が利用可能です。クリックして中身を表示してから全体をコピーし、Node-REDの`Import`から`Clipboard`を選択して内容を貼り付けてください。

# Install

Expand All @@ -58,6 +58,9 @@ $ npm run build
will generate ES5 js files.

# Revision History
* 4.0.4
- Fix an issue where TimeoutError can be thrown when valid BLE peripherals are missing

* 4.0.3
- Invoke done() callback at least one associated peripheral exists

Expand All @@ -72,6 +75,9 @@ will generate ES5 js files.
- Remove Node.js v0.12 support
- Remove [BLECAST_TM](http://www.robotsfx.com/robot/BLECAST_TM.html) node and [BLECAST_BL](http://www.robotsfx.com/robot/BLECAST_BL.html) node

* 3.x
- See 3.x branch for future 3.x releases

* 3.0.4
- Remove redundant dependency

Expand Down Expand Up @@ -118,6 +124,6 @@ will generate ES5 js files.

# Copyright and License

PNG images under icon folder are released under [CC BY-NC-SA](http://creativecommons.org/licenses/by-nc-sa/4.0/), copyright 2016 [CANDY LINE INC.](http://www.candy-line.io).
PNG images under icon folder are released under [CC BY-NC-SA](http://creativecommons.org/licenses/by-nc-sa/4.0/), copyright 2017 [CANDY LINE INC.](http://www.candy-line.io).

The project is released under MIT License. See LICENSE for detail.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-asakusa_giken",
"version": "4.0.3",
"version": "4.0.4",
"description": "Node-RED nodes for Asakusa Giken Devices",
"license": "MIT",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions src/asakusa_giken.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export default function(RED) {

this.on('close', (done) => {
if (this.bleioNode) {
bleio.remove(this, done, RED);
if (!bleio.remove(this, done, RED)) {
done();
}
}
});
bleio.clear(RED);
Expand All @@ -105,7 +107,9 @@ export default function(RED) {

this.on('close', (done) => {
if (this.bleioNode) {
bleio.remove(this, done, RED);
if (!bleio.remove(this, done, RED)) {
done();
}
}
});
bleio.clear(RED);
Expand Down
12 changes: 11 additions & 1 deletion src/bleio.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,15 @@ export function register(node, RED) {
if (CONN_DEBUG) { RED.log.info(`${TAG}[CONN_DEBUG] (register) end`); }
}

/* false when done() is never called */
export function remove(node, done, RED) {
if (!node || !node.bleioNode) {
throw new Error('invalid node');
let err = new Error('invalid node');
if (done) {
done(err);
return true;
}
throw err;
}
let localName = node.bleioNode.localName;
if (!localName) {
Expand Down Expand Up @@ -664,6 +670,10 @@ export function remove(node, done, RED) {
done();
}
}
} else {
if (done) {
done();
}
}
return true;
}
Expand Down
File renamed without changes.

0 comments on commit e0c48e1

Please sign in to comment.