Skip to content

Commit ec75e84

Browse files
author
AJ Keller
authored
Merge pull request #29 from aj-ptw/master
v0.3.5
2 parents 12f7859 + 5845fef commit ec75e84

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v0.3.5
2+
3+
### Bug Fixes
4+
5+
* Fix bug where `getFirmware` failed for patch or minor versions over 9 (aka double digits)
6+
17
# v0.3.4
28

39
### Bug Fixes

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openbci-utilities",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
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",

Diff for: src/utilities.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ function doesBufferHaveEOT (dataBuffer) {
21602160
* @return {*}
21612161
*/
21622162
function getFirmware (dataBuffer) {
2163-
const regexPattern = /v\d.\d.\d/;
2163+
const regexPattern = /v\d.\d*.\d*/;
21642164
const ret = dataBuffer.toString().match(regexPattern);
21652165
if (ret) {
21662166
const elems = ret[0].split('.');

Diff for: test/openBCIUtilities-test.js

+15
Original file line numberDiff line numberDiff line change
@@ -2159,6 +2159,21 @@ $$$`);
21592159
raw: 'v3.0.1'
21602160
});
21612161
});
2162+
it('should find a v3 and remove rc', function () {
2163+
let buf = new Buffer(`OpenBCI V3 Simulator
2164+
On Board ADS1299 Device ID: 0x12345
2165+
On Daisy ADS1299 Device ID: 0xFFFFF
2166+
LIS3DH Device ID: 0x38422
2167+
Firmware: v3.0.11
2168+
$$$`);
2169+
2170+
expect(openBCIUtilities.getFirmware(buf)).to.deep.equal({
2171+
major: 3,
2172+
minor: 0,
2173+
patch: 11,
2174+
raw: 'v3.0.11'
2175+
});
2176+
});
21622177
});
21632178
describe('#isFailureInBuffer', function () {
21642179
it('should not crash on small buff', function () {

0 commit comments

Comments
 (0)