Open andrewjaykeller opened 8 years ago
@baffo32 any thoughts on how to properly bring in ganglion code to the repo? See https://github.com/aj-ptw/simblee-js/blob/simulator/openBCIGanglion.js for the current node driver. There is going to have to be some major test writing to get coverage. I think there needs to be an index.js
file to produce a work flow that looks like
const ganglion = require('openbci').ganglion; const board32bit = require('openbci').board32bit
I think they [openbci] are working on a name for the 32 bit board, but still the 32bit board with import serialport
while ganglion would only import noble
.
Ganglion looks very different at first glance. I'd definitely at least separate the implementations into distinct, separate files; separate folders if openbci might be making more board variants.
The two different drivers should provide the same function names as each other, taking the same function arguments, when they have functions that do similar things. They should dispatch the same set of events.
(Later somebody could write a single 'openbci' driver which calls out to the others to handle all boards, and the user wouldn't have to care what kind of board was connected at all.)
If any code would be duplicated, it should be pulled out into a common base class or utilities file, so it may be re-used.
I think it could be good to handle very different firmware versions as separate drivers, too.
I have started writing this code over at my own local branch. lots of fun! so many tests to write though.
Looking to do something like this to remove the factory from the module.
https://github.com/EmergingTechnologyAdvisors/node-serialport/blob/master/lib/serialport.js
Here is what is looks like to use the ganglion code: https://github.com/OpenBCI/OpenBCI_Ganglion_Electron/blob/master/src/app.js
Update: This will not be merged with this repo until the Ganglion driver is stable. For the ganglion code please see here:
Adds support for ganglion.