File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -2160,7 +2160,7 @@ function doesBufferHaveEOT (dataBuffer) {
21602160 * @return {* }
21612161 */
21622162function 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 ( '.' ) ;
Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments