Comparing version 1.4.2 to 1.4.4
@@ -0,1 +1,16 @@ | ||
# 1.4.4 | ||
### New Features | ||
* Set max number of channels for the board to use with `.setMaxChannels()` see readme.md | ||
* Set the core info object that drives the module with `.setInfoForBoardType()` see readme.md | ||
* Get info for the core obhect that drives the module with `.getInfo()` see readme.md | ||
### Work In Progress | ||
* Bug where daisy would sometimes not be recognized which destroyed all data. | ||
# 1.4.3 | ||
### New examples | ||
* Add example of node to python | ||
# 1.4.2 | ||
@@ -2,0 +17,0 @@ |
@@ -32,2 +32,3 @@ /** | ||
/** Unable to auto find OpenBCI board */ | ||
console.log('Unable to auto find OpenBCI board'); | ||
} | ||
@@ -90,1 +91,39 @@ }); | ||
ourBoard.on('sample', sampleFunc); | ||
function exitHandler (options, err) { | ||
if (options.cleanup) { | ||
if (verbose) console.log('clean'); | ||
/** Do additional clean up here */ | ||
} | ||
if (err) console.log(err.stack); | ||
if (options.exit) { | ||
if (verbose) console.log('exit'); | ||
ourBoard.disconnect().catch(console.log); | ||
} | ||
} | ||
if (process.platform === "win32") { | ||
const rl = require("readline").createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
rl.on("SIGINT", function () { | ||
process.emit("SIGINT"); | ||
}); | ||
} | ||
// do something when app is closing | ||
process.on('exit', exitHandler.bind(null, { | ||
cleanup: true | ||
})); | ||
// catches ctrl+c event | ||
process.on('SIGINT', exitHandler.bind(null, { | ||
exit: true | ||
})); | ||
// catches uncaught exceptions | ||
process.on('uncaughtException', exitHandler.bind(null, { | ||
exit: true | ||
})); |
{ | ||
"name": "openbci", | ||
"version": "1.4.2", | ||
"version": "1.4.4", | ||
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.", | ||
@@ -39,2 +39,3 @@ "main": "openBCIBoard", | ||
"sinon": "^1.17.2", | ||
"sinon-as-promised": "^4.0.2", | ||
"sinon-chai": "^2.8.0", | ||
@@ -41,0 +42,0 @@ "snazzy": "^5.0.0" |
@@ -17,2 +17,4 @@ [![Stories in Ready](https://badge.waffle.io/OpenBCI/OpenBCI_NodeJS.png?label=ready&title=Ready)](https://waffle.io/OpenBCI/OpenBCI_NodeJS) | ||
Python researcher or developer? Check out how easy it is to [get access to the entire API in the Python example](examples/python)! | ||
### Table of Contents: | ||
@@ -77,2 +79,4 @@ --- | ||
Python researcher or developer? Check out how easy it is to [get access to the entire API in the Python example](examples/python)! | ||
### <a name="general-overview"></a> General Overview: | ||
@@ -515,2 +519,8 @@ | ||
### <a name="method-get-info"></a> .getInfo() | ||
Get the core info object. It's the object that actually drives the parsing of data. | ||
**_Returns_** Object - {{boardType: string, sampleRate: number, firmware: string, numberOfChannels: number, missedPackets: number}} | ||
### <a name="method-get-settings-for-channel"></a> .getSettingsForChannel(channelNumber) | ||
@@ -843,2 +853,30 @@ | ||
### <a name="method-set-info-for-board-type"></a> .setInfoForBoardType(boardType) | ||
Set the info property for board type. | ||
**Note: This has the potential to change the way data is parsed** | ||
**_boardType_** | ||
A String indicating the number of channels. | ||
* `default` - Default board: Sample rate is `250Hz` and number of channels is `8`. | ||
* `daisy` - Daisy board: Sample rate is `125Hz` and number of channels is `16`. | ||
**_Returns_** a promise, fulfilled if the command was sent to the write queue. Rejects if input is not `8` or `16`. | ||
### <a name="method-set-max-channels"></a> .setMaxChannels(numberOfChannels) | ||
Sends a command to the board to set the max channels. If you have a daisy attached, calling this function will re-sniff for the daisy ADS and attempt to use it. | ||
**_numberOfChannels_** | ||
A Number indicating the number of channels. | ||
* `8` - Default number of channels. | ||
* `16` - Daisy number of channels. | ||
**_Returns_** a promise, fulfilled if the command was sent to the write queue. Rejects if input is not `8` or `16`. | ||
### <a name="method-simulator-enable"></a> .simulatorEnable() | ||
@@ -845,0 +883,0 @@ |
Sorry, the diff of this file is too big to display
294652
21
5513
1236
12