@@ -1319,72 +1319,51 @@ $$$`);
1319
1319
expect ( openBCIUtilities . doesBufferHaveEOT ( buf ) ) . to . equal ( true ) ;
1320
1320
} ) ;
1321
1321
} ) ;
1322
- describe ( '#findV2Firmware' , function ( ) {
1323
- it ( 'should not crash on small buff' , function ( ) {
1324
- let buf = new Buffer ( 'AJ!' ) ;
1325
-
1326
- expect ( openBCIUtilities . findV2Firmware ( buf ) ) . to . be . false ( ) ;
1327
- } ) ;
1328
- it ( 'should not find any v2' , function ( ) {
1329
- let buf = new Buffer ( 'AJ Keller is an awesome programmer!\n I know right!' ) ;
1330
-
1331
- expect ( openBCIUtilities . findV2Firmware ( buf ) ) . to . be . false ( ) ;
1332
- } ) ;
1333
- it ( 'should not find a v2' , function ( ) {
1334
- let buf = new Buffer ( `OpenBCI V3 Simulator
1335
- On Board ADS1299 Device ID: 0x12345
1336
- LIS3DH Device ID: 0x38422$$$` ) ;
1337
-
1338
- expect ( openBCIUtilities . findV2Firmware ( buf ) ) . to . be . false ( ) ;
1339
- } ) ;
1340
- it ( 'should find a v2' , function ( ) {
1341
- let buf = new Buffer ( `OpenBCI V3 Simulator
1342
- On Board ADS1299 Device ID: 0x12345
1343
- On Daisy ADS1299 Device ID: 0xFFFFF
1344
- LIS3DH Device ID: 0x38422
1345
- Firmware: v2.0.0
1346
- $$$` ) ;
1347
-
1348
- expect ( openBCIUtilities . findV2Firmware ( buf ) ) . to . equal ( true ) ;
1349
- } ) ;
1350
- } ) ;
1351
1322
describe ( '#getMajorFirmwareVersion' , function ( ) {
1352
1323
it ( 'should not crash on small buff' , function ( ) {
1353
1324
let buf = new Buffer ( 'AJ!' ) ;
1354
1325
1355
- expect ( openBCIUtilities . getMajorFirmwareVersion ( buf ) ) . to . equal ( null ) ;
1326
+ expect ( openBCIUtilities . getFirmware ( buf ) ) . to . equal ( null ) ;
1356
1327
} ) ;
1357
1328
it ( 'should not find any v2' , function ( ) {
1358
1329
let buf = new Buffer ( 'AJ Keller is an awesome programmer!\n I know right!' ) ;
1359
1330
1360
- expect ( openBCIUtilities . getMajorFirmwareVersion ( buf ) ) . to . equal ( null )
1331
+ expect ( openBCIUtilities . getFirmware ( buf ) ) . to . equal ( null )
1361
1332
} ) ;
1362
1333
it ( 'should not find a v2' , function ( ) {
1363
1334
let buf = new Buffer ( `OpenBCI V3 Simulator
1364
1335
On Board ADS1299 Device ID: 0x12345
1365
1336
LIS3DH Device ID: 0x38422$$$` ) ;
1366
1337
1367
- expect ( openBCIUtilities . getMajorFirmwareVersion ( buf ) ) . to . equal ( null )
1338
+ expect ( openBCIUtilities . getFirmware ( buf ) ) . to . equal ( null )
1368
1339
} ) ;
1369
1340
it ( 'should find a v2' , function ( ) {
1370
1341
let buf = new Buffer ( `OpenBCI V3 Simulator
1371
1342
On Board ADS1299 Device ID: 0x12345
1372
1343
On Daisy ADS1299 Device ID: 0xFFFFF
1373
1344
LIS3DH Device ID: 0x38422
1374
- Firmware: v2.0.0
1345
+ Firmware: v2.0.1
1375
1346
$$$` ) ;
1376
1347
1377
- expect ( openBCIUtilities . getMajorFirmwareVersion ( buf ) ) . to . equal ( 'v2' ) ;
1348
+ expect ( openBCIUtilities . getFirmware ( buf ) ) . to . deep . equal ( {
1349
+ major : 2 ,
1350
+ minor : 0 ,
1351
+ patch : 1
1352
+ } ) ;
1378
1353
} ) ;
1379
1354
it ( 'should find a v3' , function ( ) {
1380
1355
let buf = new Buffer ( `OpenBCI V3 Simulator
1381
1356
On Board ADS1299 Device ID: 0x12345
1382
1357
On Daisy ADS1299 Device ID: 0xFFFFF
1383
1358
LIS3DH Device ID: 0x38422
1384
- Firmware: v3.0.0
1359
+ Firmware: v3.0.1
1385
1360
$$$` ) ;
1386
1361
1387
- expect ( openBCIUtilities . getMajorFirmwareVersion ( buf ) ) . to . equal ( 'v3' ) ;
1362
+ expect ( openBCIUtilities . getFirmware ( buf ) ) . to . deep . equal ( {
1363
+ major : 3 ,
1364
+ minor : 0 ,
1365
+ patch : 1
1366
+ } ) ;
1388
1367
} ) ;
1389
1368
} ) ;
1390
1369
describe ( '#isFailureInBuffer' , function ( ) {
0 commit comments