File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,25 @@ function OpenBCIFactory() {
612612 }
613613 } ;
614614
615+ /**
616+ * Purpose: List available ports so the user can choose a device when not
617+ * automatically found.
618+ *
619+ * Note: This method is used for convenience essentially just wrapping up
620+ * serial port.
621+ *
622+ * Author: Andy Heusser (@andyh616)
623+ * @returns {Promise }
624+ */
625+ OpenBCIBoard . prototype . listPorts = function ( ) {
626+ return new Promise ( ( resolve , reject ) => {
627+ serialPort . list ( ( err , ports ) => {
628+ if ( err ) reject ( err ) ;
629+ else resolve ( ports ) ;
630+ } )
631+ } )
632+ } ;
633+
615634
616635 /**
617636 * Purpose: Automatically find an OpenBCI board. Returns either the name
@@ -941,4 +960,4 @@ function masterBufferMaker() {
941960 packetsRead :0 ,
942961 looseBytes :0
943962 } ;
944- }
963+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " openbci-sdk" ,
3- "version" : " 0.1.8 " ,
3+ "version" : " 0.1.9 " ,
44 "description" : " A fully NodeJS based API for the OpenBCI board connecting to the hardware directly over serial" ,
55 "main" : " openBCIBoard" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments