Comparar commits

...

2 Commits

Autor SHA1 Mensagem Data
AJ Keller b51cb54f92 Merge pull request #74 from pushtheworldllc/serialport-upgrade
Enh upgrade serial port to 4.x
2016-08-10 07:35:38 -04:00
AJ Keller 19f05e362f Enh upgrade serial port to 4.x 2016-08-09 22:31:36 -04:00
4 arquivos alterados com 20 adições e 12 exclusões
+2
Ver Arquivo
@@ -2,6 +2,8 @@
[![Join the chat at https://gitter.im/OpenBCI/OpenBCI_NodeJS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OpenBCI/OpenBCI_NodeJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/OpenBCI/OpenBCI_NodeJS.svg?branch=master)](https://travis-ci.org/OpenBCI/OpenBCI_NodeJS)
[![codecov](https://codecov.io/gh/OpenBCI/OpenBCI_NodeJS/branch/master/graph/badge.svg)](https://codecov.io/gh/OpenBCI/OpenBCI_NodeJS)
[![Dependency Status](https://david-dm.org/OpenBCI/OpenBCI_NodeJS.svg)](https://david-dm.org/OpenBCI/OpenBCI_NodeJS)
[![npm](https://img.shields.io/npm/dm/openbci.svg?maxAge=2592000)](http://npmjs.com/package/openbci)
# OpenBCI Node.js SDK
+6
Ver Arquivo
@@ -1,3 +1,9 @@
# 1.2.2
### Enhancements
* Upgrade serialport to 4.x
# 1.2.1
### Bug Fixes
+9 -9
Ver Arquivo
@@ -3,7 +3,7 @@
var EventEmitter = require('events').EventEmitter,
util = require('util'),
stream = require('stream'),
serialPort = require('serialport'),
SerialPort = require('serialport'),
openBCISample = require('./openBCISample'),
k = openBCISample.k,
openBCISimulator = require('./openBCISimulator'),
@@ -240,7 +240,7 @@ function OpenBCIFactory() {
} else {
/* istanbul ignore if */
if (this.options.verbose) console.log('using real board ' + portName);
boardSerial = new serialPort.SerialPort(portName, {
boardSerial = new SerialPort(portName, {
baudRate: this.options.baudRate
},(err) => {
if (err) reject(err);
@@ -473,14 +473,14 @@ function OpenBCIFactory() {
OpenBCIBoard.prototype._writeAndDrain = function(data) {
return new Promise((resolve,reject) => {
if(!this.serial) reject('Serial port not open');
this.serial.write(data,(error,results) => {
if(results) {
this.serial.write(data,(error) => {
if(error) {
console.log('Error [writeAndDrain]: ' + error);
reject(error);
} else {
this.serial.drain(function() {
resolve();
});
} else {
console.log('Error [writeAndDrain]: ' + error);
reject(error);
}
})
});
@@ -504,7 +504,7 @@ function OpenBCIFactory() {
if (this.options.verbose) console.log('auto found sim board');
resolve(k.OBCISimulatorPortName);
} else {
serialPort.list((err, ports) => {
SerialPort.list((err, ports) => {
if(err) {
if (this.options.verbose) console.log('serial port err');
reject(err);
@@ -921,7 +921,7 @@ function OpenBCIFactory() {
*/
OpenBCIBoard.prototype.listPorts = function() {
return new Promise((resolve, reject) => {
serialPort.list((err, ports) => {
SerialPort.list((err, ports) => {
if(err) reject(err);
else {
ports.push( {
+3 -3
Ver Arquivo
@@ -1,6 +1,6 @@
{
"name": "openbci",
"version": "1.2.1",
"version": "1.2.2",
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.",
"main": "openBCIBoard",
"scripts": {
@@ -19,7 +19,7 @@
"gaussian": "^1.0.0",
"mathjs": "^3.3.0",
"performance-now": "^0.2.0",
"serialport": "3.1.2",
"serialport": "4.0.1",
"sntp": "^2.0.0",
"streamsearch": "^0.1.2"
},
@@ -31,7 +31,7 @@
"chai-as-promised": "^5.2.0",
"codecov": "^1.0.1",
"istanbul": "^0.4.4",
"mocha": "^2.3.4",
"mocha": "^3.0.2",
"sandboxed-module": "^2.0.3",
"sinon": "^1.17.2",
"sinon-chai": "^2.8.0"