Comparar commits

..

2 Commits

Autor SHA1 Mensagem Data
AJ Keller c33d08b486 Merge pull request #73 from pushtheworldllc/dev-firmware
v1.2.1 Fix for radio channel set functions
2016-08-08 22:42:36 -04:00
AJ Keller 97cff2dac9 Fix for radio channel set functions 2016-08-08 22:36:09 -04:00
5 arquivos alterados com 31 adições e 11 exclusões
+6
Ver Arquivo
@@ -1,3 +1,9 @@
# 1.2.1
### Bug Fixes
* Fixed bug where set channel function allowed for channel 0 to be set. Cannot set system to channel 0; lower limit is 1.
# 1.2.0
### New Features
+1 -1
Ver Arquivo
@@ -306,7 +306,7 @@ const OBCISimulatorStandard = 'standard';
/** OpenBCI Radio Limits */
const OBCIRadioChannelMax = 25;
const OBCIRadioChannelMin = 0;
const OBCIRadioChannelMin = 1;
const OBCIRadioPollTimeMax = 255;
const OBCIRadioPollTimeMin = 0;
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
{
"name": "openbci",
"version": "1.2.0",
"version": "1.2.1",
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.",
"main": "openBCIBoard",
"scripts": {
+1 -1
Ver Arquivo
@@ -770,7 +770,7 @@ describe('OpenBCIConstants', function() {
expect(k.OBCIRadioChannelMax).to.be.equal(25);
});
it("should get the right channel number min",function () {
expect(k.OBCIRadioChannelMin).to.be.equal(0);
expect(k.OBCIRadioChannelMin).to.be.equal(1);
});
it("should get the right poll time max",function () {
expect(k.OBCIRadioPollTimeMax).to.be.equal(255);
+22 -8
Ver Arquivo
@@ -400,9 +400,6 @@ describe('openbci-sdk',function() {
}).catch(err => done(err));
});
});
describe('#boardTests', function() {
this.timeout(3000);
before(function() {
@@ -2530,7 +2527,7 @@ describe('openbci-sdk',function() {
});
describe('#radioTestsWithBoard',function() {
this.timeout(3000);
this.timeout(0);
before(function(done) {
ourBoard = new openBCIBoard.OpenBCIBoard({
verbose: true
@@ -2583,11 +2580,11 @@ describe('openbci-sdk',function() {
done();
}).catch(err => done(err));
});
it("should be able to set the channel to 0", function(done) {
it("should be able to set the channel to 5", function(done) {
// Don't test if not using real board
if (!realBoard) return done();
ourBoard.radioChannelSet(0).then(channelNumber => {
expect(channelNumber).to.equal(0);
ourBoard.radioChannelSet(5).then(channelNumber => {
expect(channelNumber).to.equal(5);
done();
}).catch(err => done(err));
});
@@ -2596,11 +2593,13 @@ describe('openbci-sdk',function() {
if (!realBoard) return done();
var systemChanNumber = 0;
var newChanNum = 0;
// var timey = Date.now();
// Get the current system channel
ourBoard.radioChannelGet()
.then(res => {
// Store it
systemChanNumber = res.channelNumber;
// console.log(`system channel number: ${res.channelNumber}`);
if (systemChanNumber == 25) {
newChanNum = 24;
} else {
@@ -2611,9 +2610,24 @@ describe('openbci-sdk',function() {
})
.then(newChanNumActual => {
expect(newChanNumActual).to.equal(newChanNum);
return ourBoard.radioSystemStatusGet();
// timey = Date.now();
// console.log(`new chan ${newChanNumActual} got`, timey, '0ms');
return new Promise((resolve, reject) => {
setTimeout(function() {
// console.log(`get status`, Date.now(), `${Date.now() - timey}ms`);
ourBoard.radioSystemStatusGet().
then(isUp => {
// console.log('resolving', Date.now(), `${Date.now() - timey}ms`);
resolve(isUp);
})
.catch(err => {
reject(err);
})
}, 270); // Should be accurate after 270 seconds
});
})
.then(isUp => {
// console.log(`isUp test`, Date.now(), `${Date.now() - timey}ms`);
expect(isUp).to.be.false;
return ourBoard.radioChannelSetHostOverride(systemChanNumber); // Set back to good
})