Skip to content

Commit 88b0bca

Browse files
author
AJ Keller
authored
Merge pull request #27 from aj-ptw/master
ADD: complete firmware to getFirmware function
2 parents 421dc16 + 091d840 commit 88b0bca

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
language: node_js
22
node_js:
33
- "4.8.4"
4-
- "6.11.1"
5-
- "7.10.1"
6-
- "8.1.4"
4+
- "6"
5+
- "7"
6+
- "8"
7+
- "9"
78
install:
89
- npm install --all
910
script:

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v0.3.3
2+
3+
### Enhancements
4+
5+
* Add raw of version to `getFirmware`
6+
* Bump mathjs to 4.0.0 to resolve insecurity
7+
18
# v0.3.1
29

310
### Enhancements

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openbci-utilities",
3-
"version": "0.3.1",
3+
"version": "0.3.3",
44
"description": "The official utility package of Node.js SDK for the OpenBCI Biosensor Boards.",
55
"main": "dist/openbci-utilities.js",
66
"module": "src/index.js",
@@ -30,7 +30,7 @@
3030
"buffer-equal": "^1.0.0",
3131
"clone": "^2.0.0",
3232
"gaussian": "^1.0.0",
33-
"mathjs": "^3.3.0",
33+
"mathjs": "^4.0.0",
3434
"performance-now": "^2.1.0",
3535
"streamsearch": "^0.1.2"
3636
},

src/utilities.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,8 @@ function getFirmware (dataBuffer) {
21642164
return {
21652165
major: Number(elems[0][1]),
21662166
minor: Number(elems[1]),
2167-
patch: Number(elems[2])
2167+
patch: Number(elems[2]),
2168+
raw: ret[0]
21682169
};
21692170
} else return ret;
21702171
}

test/openBCIUtilities-test.js

+19-2
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,8 @@ $$$`);
21252125
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
21262126
major: 2,
21272127
minor: 0,
2128-
patch: 1
2128+
patch: 1,
2129+
raw: 'v2.0.1'
21292130
});
21302131
});
21312132
it('should find a v3', function () {
@@ -2139,7 +2140,23 @@ $$$`);
21392140
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
21402141
major: 3,
21412142
minor: 0,
2142-
patch: 1
2143+
patch: 1,
2144+
raw: 'v3.0.1'
2145+
});
2146+
});
2147+
it('should find a v3 and remove rc', function () {
2148+
let buf = new Buffer(`OpenBCI V3 Simulator
2149+
On Board ADS1299 Device ID: 0x12345
2150+
On Daisy ADS1299 Device ID: 0xFFFFF
2151+
LIS3DH Device ID: 0x38422
2152+
Firmware: v3.0.1-rc1
2153+
$$$`);
2154+
2155+
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
2156+
major: 3,
2157+
minor: 0,
2158+
patch: 1,
2159+
raw: 'v3.0.1'
21432160
});
21442161
});
21452162
});

0 commit comments

Comments
 (0)