Skip to content

Commit a6525d5

Browse files
author
AJ Keller
authored
Merge pull request #4 from aj-ptw/master
v0.0.6
2 parents bd662c8 + 0753ffa commit a6525d5

File tree

6 files changed

+517
-147
lines changed

6 files changed

+517
-147
lines changed

changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# 0.0.6
2+
3+
### Bug Fixes
4+
5+
* Could not use 'daisy' with sample rate setter.
6+
7+
### New Features
8+
9+
* Add function in utilities for making daisy packets.
10+
* Add code to `getChannelDataArray` for ganglion and daisy data being routed over wifi
11+
* Create idea of protocols i.e. `BLE`, `Wifi`, and `Serial`
12+
13+
### Breaking changes
14+
15+
* `getChannelDataArray` now takes object as only arg.
16+
117
# 0.0.5
218

319
### Bug Fixes

openBCIConstants.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,17 @@ const obciRadioCmdBaudRateSetFast = 0x06;
230230
const obciRadioCmdSystemStatus = 0x07;
231231

232232
/** Possible number of channels */
233+
const obciNumberOfChannelsCyton = 8;
233234
const obciNumberOfChannelsDaisy = 16;
234-
const obciNumberOfChannelsDefault = 8;
235+
const obciNumberOfChannelsDefault = obciNumberOfChannelsCyton;
235236
const obciNumberOfChannelsGanglion = 4;
236237

237238
/** Possible OpenBCI board types */
238239
const obciBoardCyton = 'cyton';
239240
const obciBoardDaisy = 'daisy';
240241
const obciBoardDefault = 'default';
241242
const obciBoardGanglion = 'ganglion';
243+
const obciBoardNone = 'none';
242244

243245
/** Possible Simulator Line Noise injections */
244246
const obciSimulatorLineNoiseHz60 = '60Hz';
@@ -455,14 +457,14 @@ const obciGanglionPacket19Bit = {
455457
dataStart: 1,
456458
dataStop: 20
457459
};
458-
const obciGanglionMCP3912Gain = 1.0; // assumed gain setting for MCP3912. NEEDS TO BE ADJUSTABLE JM
460+
const obciGanglionMCP3912Gain = 51.0; // assumed gain setting for MCP3912. NEEDS TO BE ADJUSTABLE JM
459461
const obciGanglionMCP3912Vref = 1.2; // reference voltage for ADC in MCP3912 set in hardware
460462
const obciGanglionPrefix = 'Ganglion';
461463
const obciGanglionSyntheticDataEnable = 't';
462464
const obciGanglionSyntheticDataDisable = 'T';
463465
const obciGanglionImpedanceStart = 'z';
464466
const obciGanglionImpedanceStop = 'Z';
465-
const obciGanglionScaleFactorPerCountVolts = obciGanglionMCP3912Vref / (8388607.0 * obciGanglionMCP3912Gain * 1.5 * 51.0);
467+
const obciGanglionScaleFactorPerCountVolts = obciGanglionMCP3912Vref / (8388607.0 * obciGanglionMCP3912Gain * 1.5);
466468

467469
/** Simblee */
468470
const simbleeUuidService = 'fe84';
@@ -483,6 +485,11 @@ const obciNobleEmitterScanStop = 'scanStop';
483485
const obciNobleEmitterStateChange = 'stateChange';
484486
const obciNobleStatePoweredOn = 'poweredOn';
485487

488+
/** Protocols */
489+
const obciProtocolBLE = "ble";
490+
const obciProtocolSerial = "serial";
491+
const obciProtocolWifi = "wifi";
492+
486493
module.exports = {
487494
/** Turning channels off */
488495
OBCIChannelOff1: obciChannelOff1,
@@ -877,6 +884,7 @@ module.exports = {
877884
/** Triggers */
878885
OBCITrigger: obciTrigger,
879886
/** Possible number of channels */
887+
OBCINumberOfChannelsCyton: obciNumberOfChannelsCyton,
880888
OBCINumberOfChannelsDaisy: obciNumberOfChannelsDaisy,
881889
OBCINumberOfChannelsDefault: obciNumberOfChannelsDefault,
882890
OBCINumberOfChannelsGanglion: obciNumberOfChannelsGanglion,
@@ -885,12 +893,16 @@ module.exports = {
885893
OBCIBoardDaisy: obciBoardDaisy,
886894
OBCIBoardDefault: obciBoardDefault,
887895
OBCIBoardGanglion: obciBoardGanglion,
896+
OBCIBoardNone: obciBoardNone,
888897
numberOfChannelsForBoardType: boardType => {
889898
switch (boardType) {
890899
case obciBoardDaisy:
891900
return obciNumberOfChannelsDaisy;
892901
case obciBoardGanglion:
893902
return obciNumberOfChannelsGanglion;
903+
case obciBoardNone:
904+
return 0;
905+
case obciBoardCyton:
894906
default:
895907
return obciNumberOfChannelsDefault;
896908
}
@@ -1165,7 +1177,11 @@ module.exports = {
11651177
isPeripheralGanglion,
11661178
commandSampleRateForCmdCyton,
11671179
commandSampleRateForCmdGanglion,
1168-
commandBoardModeForMode
1180+
commandBoardModeForMode,
1181+
/** Protocols */
1182+
OBCIProtocolBLE: obciProtocolBLE,
1183+
OBCIProtocolSerial: obciProtocolSerial,
1184+
OBCIProtocolWifi: obciProtocolWifi
11691185
};
11701186

11711187
/**
@@ -1319,7 +1335,7 @@ function sampleRateSetter (boardType, sampleRate) {
13191335
sampleRate = Math.floor(sampleRate);
13201336

13211337
let func;
1322-
if (boardType === obciBoardCyton) {
1338+
if (boardType === obciBoardCyton || boardType === obciBoardDaisy) {
13231339
func = commandSampleRateForCmdCyton;
13241340
} else if (boardType === obciBoardGanglion) {
13251341
func = commandSampleRateForCmdGanglion;

0 commit comments

Comments
 (0)