Skip to content

Commit

Permalink
Merge pull request #27 from aj-ptw/master
Browse files Browse the repository at this point in the history
ADD: complete firmware to getFirmware function
  • Loading branch information
AJ Keller authored Mar 8, 2018
2 parents 421dc16 + 091d840 commit 88b0bca
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js
node_js:
- "4.8.4"
- "6.11.1"
- "7.10.1"
- "8.1.4"
- "6"
- "7"
- "8"
- "9"
install:
- npm install --all
script:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v0.3.3

### Enhancements

* Add raw of version to `getFirmware`
* Bump mathjs to 4.0.0 to resolve insecurity

# v0.3.1

### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openbci-utilities",
"version": "0.3.1",
"version": "0.3.3",
"description": "The official utility package of Node.js SDK for the OpenBCI Biosensor Boards.",
"main": "dist/openbci-utilities.js",
"module": "src/index.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
"buffer-equal": "^1.0.0",
"clone": "^2.0.0",
"gaussian": "^1.0.0",
"mathjs": "^3.3.0",
"mathjs": "^4.0.0",
"performance-now": "^2.1.0",
"streamsearch": "^0.1.2"
},
Expand Down
3 changes: 2 additions & 1 deletion src/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,8 @@ function getFirmware (dataBuffer) {
return {
major: Number(elems[0][1]),
minor: Number(elems[1]),
patch: Number(elems[2])
patch: Number(elems[2]),
raw: ret[0]
};
} else return ret;
}
Expand Down
21 changes: 19 additions & 2 deletions test/openBCIUtilities-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,8 @@ $$$`);
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
major: 2,
minor: 0,
patch: 1
patch: 1,
raw: 'v2.0.1'
});
});
it('should find a v3', function () {
Expand All @@ -2139,7 +2140,23 @@ $$$`);
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
major: 3,
minor: 0,
patch: 1
patch: 1,
raw: 'v3.0.1'
});
});
it('should find a v3 and remove rc', function () {
let buf = new Buffer(`OpenBCI V3 Simulator
On Board ADS1299 Device ID: 0x12345
On Daisy ADS1299 Device ID: 0xFFFFF
LIS3DH Device ID: 0x38422
Firmware: v3.0.1-rc1
$$$`);

expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
major: 3,
minor: 0,
patch: 1,
raw: 'v3.0.1'
});
});
});
Expand Down

0 comments on commit 88b0bca

Please sign in to comment.