File tree 4 files changed +23
-2
lines changed
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
+
1
7
# v0.3.4
2
8
3
9
### Bug Fixes
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " openbci-utilities" ,
3
- "version" : " 0.3.4 " ,
3
+ "version" : " 0.3.5 " ,
4
4
"description" : " The official utility package of Node.js SDK for the OpenBCI Biosensor Boards." ,
5
5
"main" : " dist/openbci-utilities.js" ,
6
6
"module" : " src/index.js" ,
Original file line number Diff line number Diff line change @@ -2160,7 +2160,7 @@ function doesBufferHaveEOT (dataBuffer) {
2160
2160
* @return {* }
2161
2161
*/
2162
2162
function getFirmware ( dataBuffer ) {
2163
- const regexPattern = / v \d .\d .\d / ;
2163
+ const regexPattern = / v \d .\d * .\d * / ;
2164
2164
const ret = dataBuffer . toString ( ) . match ( regexPattern ) ;
2165
2165
if ( ret ) {
2166
2166
const elems = ret [ 0 ] . split ( '.' ) ;
Original file line number Diff line number Diff line change @@ -2159,6 +2159,21 @@ $$$`);
2159
2159
raw : 'v3.0.1'
2160
2160
} ) ;
2161
2161
} ) ;
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
+ } ) ;
2162
2177
} ) ;
2163
2178
describe ( '#isFailureInBuffer' , function ( ) {
2164
2179
it ( 'should not crash on small buff' , function ( ) {
You can’t perform that action at this time.
0 commit comments