Skip to content

Commit 3e4b9a2

Browse files
author
AJ Keller
authored
Merge pull request #159 from aj-ptw/sync-chan-set
ADD: syncRegisterSettings now resolves channel settings object
2 parents d9f024f + 74c4d97 commit 3e4b9a2

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ ourBoard.connect(portName)
10731073
10741074
Syncs the internal channel settings object with a cyton, this will take about over a second because there are delays between the register reads in the firmware.
10751075
1076-
**_Returns_** a promise, fulfilled once the channel settings have been synced and reject on error.
1076+
**_Returns_** a promise, fulfilled with channel settings array, where each element is a standard channel setting object, once the channel settings have been synced and reject on error.
10771077
10781078
#### <a name="method-test-signal"></a> .testSignal(signal)
10791079

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 2.1.4
2+
3+
### Enhancements
4+
5+
* syncRegisterSettings now resolves channel setting object
6+
* Bumped openbci-utilities to v0.1.5
7+
18
# 2.1.3
29

310
### Enhancements

openBCICyton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ Cyton.prototype.syncRegisterSettings = function () {
12031203
this._rawDataPacketToSample.data = data;
12041204
try {
12051205
obciUtils.syncChannelSettingsWithRawData(this._rawDataPacketToSample);
1206-
resolve();
1206+
resolve(this._rawDataPacketToSample.channelSettings);
12071207
} catch (e) {
12081208
reject(e);
12091209
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openbci",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.",
55
"main": "index.js",
66
"scripts": {
@@ -21,7 +21,7 @@
2121
"gaussian": "^1.0.0",
2222
"lodash": "^4.17.4",
2323
"mathjs": "^3.14.2",
24-
"openbci-utilities": "^0.1.4",
24+
"openbci-utilities": "^0.1.5",
2525
"performance-now": "^2.1.0",
2626
"safe-buffer": "^5.1.1",
2727
"serialport": "4.0.7",

test/openBCICyton-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,8 @@ describe('openbci-sdk', function () {
13581358
});
13591359
it('should send the correct register setting', function (done) {
13601360
ourBoard.syncRegisterSettings()
1361-
.then(() => {
1361+
.then((channelSettings) => {
1362+
expect(channelSettings).to.not.equal(null);
13621363
done();
13631364
}).catch(done);
13641365
});

0 commit comments

Comments
 (0)