Skip to content

Commit a680dd6

Browse files
author
AJ Keller
committed
Fix sample rate setter to work with cyton
1 parent 3f22631 commit a680dd6

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.0.6
2+
3+
### Bug Fixes
4+
5+
* Could not use 'daisy' with sample rate setter.
6+
7+
18
# 0.0.5
29

310
### Bug Fixes

openBCIConstants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ function sampleRateSetter (boardType, sampleRate) {
13191319
sampleRate = Math.floor(sampleRate);
13201320

13211321
let func;
1322-
if (boardType === obciBoardCyton) {
1322+
if (boardType === obciBoardCyton || boardType === obciBoardDaisy) {
13231323
func = commandSampleRateForCmdCyton;
13241324
} else if (boardType === obciBoardGanglion) {
13251325
func = commandSampleRateForCmdGanglion;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openbci-utilities",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "The official utility package of Node.js SDK for the OpenBCI Biosensor Boards.",
55
"main": "index.js",
66
"scripts": {

test/openBCIConstants-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,8 +1587,17 @@ describe('OpenBCIConstants', function () {
15871587
done(err);
15881588
});
15891589
});
1590+
it('Works for daisy', function (done) {
1591+
k.getSampleRateSetter('daisy', 1000).then(function (arrayOfCommands) {
1592+
arrayOfCommands[0].should.equal('~');
1593+
arrayOfCommands[1].should.equal('4');
1594+
done();
1595+
}).catch(function (err) {
1596+
done(err);
1597+
});
1598+
});
15901599
it('Invalid board type', function (done) {
1591-
k.getSampleRateSetter('daisy', 1600).should.be.rejected.and.notify(done);
1600+
k.getSampleRateSetter('taco', 1600).should.be.rejected.and.notify(done);
15921601
});
15931602
it('Invalid board type type', function (done) {
15941603
k.getSampleRateSetter(10, 1600).should.be.rejected.and.notify(done);

0 commit comments

Comments
 (0)