Skip to content

Commit bd662c8

Browse files
author
AJ Keller
authored
Merge pull request #3 from aj-ptw/master
Fix up sample objects when not scaling
2 parents 8e49441 + 3f22631 commit bd662c8

File tree

6 files changed

+131
-136
lines changed

6 files changed

+131
-136
lines changed

.travis.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
language: node_js
22
node_js:
3-
- "4.0"
4-
- "4.1"
5-
- "4.2"
6-
- "4.3"
7-
- "4.4"
8-
- "4.5"
9-
- "4.6"
10-
- "5.11.0"
11-
- "6.0"
12-
- "6.1"
13-
- "6.2"
14-
- "6.3"
15-
- "6.4"
16-
- "6.5"
17-
- "6.6"
18-
- "6.7"
19-
- "6.8"
3+
- "4.8.4"
4+
- "6.11.1"
5+
- "7.10.1"
6+
- "8.1.4"
207
install:
218
- npm install --all
229
script:

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.0.5
2+
3+
### Bug Fixes
4+
5+
* When not scaling outputs `channelDataCounts` instead of `channelData`
6+
17
# 0.0.4
28

39
### Bug Fixes

openBCIConstants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ const obciEmitterRawDataPacket = 'rawDataPacket';
414414
const obciEmitterReady = 'ready';
415415
const obciEmitterSample = 'sample';
416416
const obciEmitterSynced = 'synced';
417+
const obciEmitterWifiShield = 'wifiShield';
417418

418419
/** Accel packets */
419420
const obciGanglionAccelAxisX = 1;
@@ -1109,6 +1110,7 @@ module.exports = {
11091110
OBCIEmitterReady: obciEmitterReady,
11101111
OBCIEmitterSample: obciEmitterSample,
11111112
OBCIEmitterSynced: obciEmitterSynced,
1113+
OBCIEmitterWifiShield: obciEmitterWifiShield,
11121114
/** Emitters */
11131115
/** Accel packets */
11141116
OBCIGanglionAccelAxisX: obciGanglionAccelAxisX,

openBCIUtilities.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ function parsePacketStandardAccel (o) {
966966

967967
if (k.isUndefined(o.scale) || k.isNull(o.scale)) o.scale = true;
968968
if (o.scale) sampleObject.channelData = getChannelDataArray(o.rawDataPacket, o.gains);
969-
else sampleObject.channelData = getChannelDataArrayNoScale(o.rawDataPacket);
969+
else sampleObject.channelDataCounts = getChannelDataArrayNoScale(o.rawDataPacket);
970970

971971
if (k.getVersionNumber(process.version) >= 6) {
972972
// From introduced in node version 6.x.x
@@ -1007,7 +1007,7 @@ function parsePacketStandardRawAux (o) {
10071007
// Store the channel data
10081008
if (k.isUndefined(o.scale) || k.isNull(o.scale)) o.scale = true;
10091009
if (o.scale) sampleObject.channelData = getChannelDataArray(o.rawDataPacket, o.gains);
1010-
else sampleObject.channelData = getChannelDataArrayNoScale(o.rawDataPacket);
1010+
else sampleObject.channelDataCounts = getChannelDataArrayNoScale(o.rawDataPacket);
10111011

10121012
// Slice the buffer for the aux data
10131013
if (k.getVersionNumber(process.version) >= 6) {
@@ -1075,7 +1075,7 @@ function parsePacketTimeSyncedAccel (o) {
10751075

10761076
if (k.isUndefined(o.scale) || k.isNull(o.scale)) o.scale = true;
10771077
if (o.scale) sampleObject.channelData = getChannelDataArray(o.rawDataPacket, o.gains);
1078-
else sampleObject.channelData = getChannelDataArrayNoScale(o.rawDataPacket);
1078+
else sampleObject.channelDataCounts = getChannelDataArrayNoScale(o.rawDataPacket);
10791079

10801080
return sampleObject;
10811081
}
@@ -1124,7 +1124,7 @@ function parsePacketTimeSyncedRawAux (o) {
11241124
// Grab the channel data.
11251125
if (k.isUndefined(o.scale) || k.isNull(o.scale)) o.scale = true;
11261126
if (o.scale) sampleObject.channelData = getChannelDataArray(o.rawDataPacket, o.gains);
1127-
else sampleObject.channelData = getChannelDataArrayNoScale(o.rawDataPacket);
1127+
else sampleObject.channelDataCounts = getChannelDataArrayNoScale(o.rawDataPacket);
11281128

11291129
return sampleObject;
11301130
}
@@ -1182,7 +1182,7 @@ function getFromTimePacketAccel (dataBuf, accelArray) {
11821182
/**
11831183
* @description Grabs a raw aux value from a raw but time synced packet.
11841184
* @param dataBuf {Buffer} - The 33byte raw time synced raw aux packet
1185-
* @returns {Promise} - Fulfills a 2 byte buffer
1185+
* @returns {Buffer|SafeBuffer|Buffer2} - Fulfills a 2 byte buffer
11861186
*/
11871187
function getFromTimePacketRawAux (dataBuf) {
11881188
if (dataBuf.byteLength !== k.OBCIPacketSize) {

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.4",
3+
"version": "0.0.5",
44
"description": "The official utility package of Node.js SDK for the OpenBCI Biosensor Boards.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)