openbci-archive / OpenBCI_NodeJS

Node.js SDK for the all OpenBCI Biosensor Boards
https://www.npmjs.com/package/openbci
138 stars 50 forks source link

Tracking: Ganglion support #80

Open andrewjaykeller opened 8 years ago

andrewjaykeller commented 8 years ago

Adds support for ganglion.

andrewjaykeller commented 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.

baffo32 commented 8 years ago

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.

andrewjaykeller commented 8 years ago

I have started writing this code over at my own local branch. lots of fun! so many tests to write though.

andrewjaykeller commented 8 years ago

Looking to do something like this to remove the factory from the module.

https://github.com/EmergingTechnologyAdvisors/node-serialport/blob/master/lib/serialport.js

andrewjaykeller commented 8 years ago

Here is what is looks like to use the ganglion code: https://github.com/OpenBCI/OpenBCI_Ganglion_Electron/blob/master/src/app.js

andrewjaykeller commented 7 years ago

Update: This will not be merged with this repo until the Ganglion driver is stable. For the ganglion code please see here:

https://github.com/OpenBCI/OpenBCI_NodeJS_Ganglion