Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Baba committed Jul 10, 2017
2 parents f9b2560 + 857e69c commit bbdb07e
Show file tree
Hide file tree
Showing 7 changed files with 1,345 additions and 38 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
node-red-contrib-generic-ble
===

A Node-RED node for providing access to generic BLE devices via GATT.

**ALPHA RELEASE** : not yet available in [flows.nodered.org](https://flows.nodered.org)

# How to install

```
cd ~/.node-red
npm install node-red-contrib-generic-ble
```

# HCI Dump Debugging

```
sudo apt-get update
sudo apt-get install bluez-hcidump
```

then

```
sudo hcidump -t -x
```

# Enabling trace log

Set `GENERIC_BLE_TRACE=true` on starting Node-RED.

# Known Issues

Connecting to peripherals keeps failing in some cases after selecting a BLE peripheral from the scan result select box in the Generic BLE node configuration dialog. If you get stuck in that case, stop Node-RED and run `sudo hciconfig hci0 reset` (replace `hci0` with a proper interface if necessary) then start Node-RED again.

# Revision History

* 0.1.0
- Initial Release (alpha)
- `node-red` keyword is not yet added
39 changes: 15 additions & 24 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
const gulp = require('gulp');
const util = require("gulp-util");
const babel = require('gulp-babel');
const browserify = require('browserify');
const babelify = require('babelify');
const uglify = require('gulp-uglify');
const del = require('del');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const jshint = require('gulp-jshint');
const mocha = require('gulp-mocha');
const sourcemaps = require('gulp-sourcemaps');
Expand All @@ -15,7 +11,6 @@ const htmlmin = require('gulp-htmlmin');
const cleancss = require('gulp-clean-css');
const less = require('gulp-less');
const manifest = require('gulp-manifest');
const shim = require('browserify-shim');
const yaml = require('gulp-yaml');

const minified = process.env.NODE_ENV === 'production';
Expand All @@ -40,6 +35,12 @@ gulp.task('clean', () => {
]);
});

gulp.task('cleanTestJs', () => {
return del([
'dist/**/*.test.js',
]);
});

gulp.task('i18n', () => {
return gulp.src([
'./src/locales/**/*.{yaml,yml}'
Expand All @@ -57,25 +58,15 @@ gulp.task('assets', ['i18n'], () => {
});

gulp.task('js', ['assets'], () => {
return browserify({
entries: './src/generic-ble.js',
debug: true
})
.transform(babelify, {
return gulp.src('./src/**/*.js')
.pipe(gulpif(sourcemapEnabled, sourcemaps.init(), util.noop()))
.pipe(babel({
minified: minified,
compact: minified,
presets: ["es2015"],
plugins: ['add-module-exports'],
sourceMaps: sourcemapEnabled,
}).on('error', util.log)
.transform(shim, {
global: true
}).on('error', util.log)
.bundle()
.pipe(source('generic-ble.js'))
.pipe(buffer())
.pipe(gulpif(sourcemapEnabled, sourcemaps.init({loadMaps: true}), util.noop()))
.pipe(uglify({
plugins: ['add-module-exports']
}))
.pipe(gulpif(!sourcemapEnabled, uglify({
mangle: minified,
compress: {
dead_code: true,
Expand All @@ -84,12 +75,12 @@ gulp.task('js', ['assets'], () => {
unused: true,
toplevel: true,
if_return: true,
drop_console: !sourcemapEnabled,
drop_console: true,
conditionals: true,
unsafe_math: true,
unsafe: true
},
}))
}), util.noop()))
.pipe(gulpif(sourcemapEnabled, sourcemaps.write(), util.noop()))
.pipe(gulp.dest('./dist'));
});
Expand Down Expand Up @@ -119,7 +110,7 @@ gulp.task('testAssets', () => {
.pipe(gulp.dest('./dist'));
});

gulp.task('testJs', ['build'], () => {
gulp.task('testJs', ['cleanTestJs', 'build'], () => {
return gulp.src('./tests/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel({
Expand Down
18 changes: 5 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-generic-ble",
"version": "1.0.0",
"version": "0.1.0",
"description": "Node-RED nodes for generic BLE devices",
"license": "MIT",
"repository": {
Expand All @@ -19,27 +19,20 @@
},
"homepage": "https://github.com/CANDY-LINE/node-red-contrib-generic-ble#readme",
"keywords": [
"node-red",
"bluetooth",
"BLE",
"bluetooth low energy",
"bluetooth smart",
"CANDY RED",
"CANDY EGG"
],
"browserify-shim": {
},
"devDependencies": {
"node-red": "^0.16.2",
"babel": "^6.23.0",
"babel-cli": "^6.24.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-babili": "0.0.12",
"babel-preset-es2015": "^6.24.0",
"babelify": "^7.3.0",
"browserify": "^14.3.0",
"browserify-shim": "^3.8.14",
"chai": "^3.3.0",
"del": "^2.2.2",
"gulp": "^3.9.1",
Expand All @@ -62,14 +55,13 @@
"jshint-stylish": "^2.0.1",
"mocha": "^3.0.2",
"sinon": "^2.1.0",
"supertest": "^1.1.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
"supertest": "^1.1.0"
},
"dependencies": {
"noble": "^1.8.1",
"source-map-support": "^0.4.2",
"lru-cache": "^4.0.0"
"node-cache": "^4.1.0",
"queue": "^4.2.1",
"source-map-support": "^0.4.2"
},
"node-red": {
"nodes": {
Expand Down
Loading

0 comments on commit bbdb07e

Please sign in to comment.