Skip to content

Commit

Permalink
Merge remote-tracking branch 'openbci/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey1994 committed Dec 13, 2019
2 parents ecc4488 + 619bdf2 commit 83ee597
Show file tree
Hide file tree
Showing 23 changed files with 437 additions and 261 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Expand Up @@ -105,12 +105,11 @@ script:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/installed/lib python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/cyton_linux.py valgrind --error-exitcode=1 --leak-check=full $TRAVIS_BUILD_DIR/tests/cpp/get_data_demo/build/brainflow_get_data --board-id 2 --serial-port ;
fi
# tests for novaxr
- sudo -H python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py python3 $TRAVIS_BUILD_DIR/tests/python/brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/installed/lib python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py $TRAVIS_BUILD_DIR/tests/cpp/get_data_demo/build/brainflow_get_data --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- sudo -H python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py python3 $TRAVIS_BUILD_DIR/tests/python/brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/installed/lib python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py $TRAVIS_BUILD_DIR/tests/cpp/get_data_demo/build/brainflow_get_data --board-id 3 --ip-address 127.0.0.1
- if [ `which valgrind` ]; then
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/installed/lib python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py valgrind --error-exitcode=1 --leak-check=full $TRAVIS_BUILD_DIR/tests/cpp/get_data_demo/build/brainflow_get_data --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1 ;
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRAVIS_BUILD_DIR/installed/lib python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_udp.py valgrind --error-exitcode=1 --leak-check=full $TRAVIS_BUILD_DIR/tests/cpp/get_data_demo/build/brainflow_get_data --board-id 3 --ip-address 127.0.0.1 ;
fi
- sudo -H python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/novaxr_tcp.py python3 $TRAVIS_BUILD_DIR/tests/python/brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1 --ip-protocol 2
# tests for wifi shield, fails on macos due to an issue in emulator
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo -H python3 $TRAVIS_BUILD_DIR/emulator/brainflow_emulator/wifi_shield_emulator.py python3 $TRAVIS_BUILD_DIR/tests/python/brainflow_get_data.py --log --board-id 4 --ip-address 127.0.0.1 --ip-port 17982 ;
Expand Down
30 changes: 18 additions & 12 deletions README.md
@@ -1,10 +1,23 @@
# BrainFlow

## [Documentation, Contributing guide and other information](https://brainflow.readthedocs.io/)
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors.

Brainflow is a library intended to obtain, parse and analyze EEG\EMG\ECG... data from any BCI board.
#### Advantages of BrainFlow:

It provides a **uniform API for all supported boards**, it means that you can switch boards without any changes in code, also if you add your board to BrainFlow it will work with almost all applications built on top on BrainFlow from the box. Also there is **powerfull API to perform signal processing** which you can use even without BCI headset.
* powerful API with many features to simplify development
* Straightforward API for data acquisition
* Powerful API for signal filtering, denoising, downsampling...
* Development tools like Synthetic board, Streaming board, logging API
* easy to use
* BrainFlow has many bindings, you can choose programming language you like
* All programming languages provide the same API, so it's simple to switch
* API is uniform for all boards, it makes applications on top of BrainFlow almost board agnostic
* easy to support and extend
* Code to read data and to perform signal processing is implemented only once in C/C++, bindings just call C/C++ methods
* Powerful CI/CD system which runs integrations tests for each commit automatically using BrainFlow's Emulator
* Simplified process to add new boards and methods

## [BrainFlow Docs, Dev and User guides and other information](https://brainflow.readthedocs.io)

## Build status

Expand All @@ -21,17 +34,10 @@ Compiled with:

[![Build status](https://ci.appveyor.com/api/projects/status/4gr8uy65f86eh2b5/branch/master?svg=true)](https://ci.appveyor.com/project/Andrey1994/brainflow/branch/master)

## Extend BrainFLow SDK

*We will be glad to add new boards, signal processing methods and new features to BrainFlow SDK.*
*For more information about process of adding new features to BrainFlow read* [this](https://brainflow.readthedocs.io/en/stable/BrainFlowDev.html)

*Also we can help you to integrate BrainFlow SDK to your apps, fromeworks etc.*

## Brainflow Bindings
We support bindings for:
* [python](./python-package)
* [java](./java-package/brainflow/)
* [Python](./python-package)
* [Java](./java-package/brainflow/)
* [R](./r-package/)
* [C++](./cpp-package/)
* [C# (Windows only)](./csharp-package/brainflow/)
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Expand Up @@ -69,11 +69,11 @@ test_script:
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\cyton_windows.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build\Release\brainflow_get_data.exe --board-id 2 --serial-port
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\cyton_windows.py %APPVEYOR_BUILD_FOLDER%\csharp-package\brainflow\brainflow_get_data\bin\Release\test.exe --board-id 2 --serial-port
# tests for novaxr
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py python %APPVEYOR_BUILD_FOLDER%\tests\python\brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py python %APPVEYOR_BUILD_FOLDER%\tests\python\brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1 --streamer-params file://file_streamer.csv:w
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build32\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\csharp-package\brainflow\brainflow_get_data\bin\Release\test.exe --board-id 3 --ip-address 127.0.0.1 --ip-protocol 1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py python %APPVEYOR_BUILD_FOLDER%\tests\python\brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py python %APPVEYOR_BUILD_FOLDER%\tests\python\brainflow_get_data.py --board-id 3 --ip-address 127.0.0.1 --streamer-params file://file_streamer.csv:w
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build32\Release\brainflow_get_data.exe --board-id 3 --ip-address 127.0.0.1
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\novaxr_udp.py %APPVEYOR_BUILD_FOLDER%\csharp-package\brainflow\brainflow_get_data\bin\Release\test.exe --board-id 3 --ip-address 127.0.0.1
# tests for wifi shield based boards
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\wifi_shield_emulator.py python %APPVEYOR_BUILD_FOLDER%\tests\python\brainflow_get_data.py --board-id 4 --ip-address 127.0.0.1 --ip-port 17982
- python %APPVEYOR_BUILD_FOLDER%\emulator\brainflow_emulator\wifi_shield_emulator.py %APPVEYOR_BUILD_FOLDER%\tests\cpp\get_data_demo\build\Release\brainflow_get_data.exe --board-id 5 --ip-address 127.0.0.1 --ip-port 17983
Expand Down
34 changes: 6 additions & 28 deletions brainflow_boards.json
Expand Up @@ -11,11 +11,7 @@
"ecg_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eog_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eda_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"ppg_channels" : [],
"accel_channels" : [9, 10, 11],
"analog_channels" : [],
"gyro_channels": [],
"other_channels": []
"accel_channels" : [9, 10, 11]
},
"0" : {
"name": "Cyton",
Expand All @@ -28,10 +24,8 @@
"ecg_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eog_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eda_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"ppg_channels" : [],
"accel_channels" : [9, 10, 11],
"analog_channels" : [19, 20, 21],
"gyro_channels": [],
"other_channels": [12, 13, 14, 15, 16, 17, 18]
},
"1" : {
Expand All @@ -45,11 +39,7 @@
"ecg_channels" : [1, 2, 3, 4],
"eog_channels" : [1, 2, 3, 4],
"eda_channels" : [1, 2, 3, 4],
"ppg_channels" : [],
"accel_channels" : [5, 6, 7],
"analog_channels" : [],
"gyro_channels": [],
"other_channels": []
"accel_channels" : [5, 6, 7]
},
"2" : {
"name": "CytonDaisy",
Expand All @@ -62,28 +52,22 @@
"ecg_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"eog_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"eda_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"ppg_channels" : [],
"accel_channels" : [17, 18, 19],
"analog_channels" : [27, 28, 29],
"gyro_channels": [],
"other_channels": [20, 21, 22, 23, 24, 25, 26]
},
"3" : {
"name": "NovaXR",
"sampling_rate": 1000,
"package_num_channel" : 0,
"timestamp_channel" : 25,
"num_rows" : 26,
"timestamp_channel" : 21,
"num_rows" : 22,
"battery_channel" : 20,
"eeg_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
"emg_channels" : [11, 12, 13, 14, 15, 16],
"ecg_channels" : [],
"eog_channels" : [],
"eda_channels" : [18],
"ppg_channels" : [17],
"accel_channels" : [],
"analog_channels" : [],
"gyro_channels": [],
"other_channels": []
"temperature_channels" : [19]
},
"4" : {
"name": "GanglionWifi",
Expand All @@ -96,10 +80,8 @@
"ecg_channels" : [1, 2, 3, 4],
"eog_channels" : [1, 2, 3, 4],
"eda_channels" : [1, 2, 3, 4],
"ppg_channels" : [],
"accel_channels" : [5, 6, 7],
"analog_channels" : [15, 16, 17],
"gyro_channels": [],
"other_channels": [8, 9, 10, 11, 12, 13, 14]
},
"5" : {
Expand All @@ -113,10 +95,8 @@
"ecg_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eog_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"eda_channels" : [1, 2, 3, 4, 5, 6, 7, 8],
"ppg_channels" : [],
"accel_channels" : [8, 10, 11],
"analog_channels" : [19, 20, 21],
"gyro_channels": [],
"other_channels": [12, 13, 14, 15, 16, 17, 18]
},
"6" : {
Expand All @@ -130,10 +110,8 @@
"ecg_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"eog_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"eda_channels" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"ppg_channels" : [],
"accel_channels" : [17, 18, 19],
"analog_channels" : [27, 28, 29],
"gyro_channels": [],
"other_channels": [20, 21, 22, 23, 24, 25, 26]
}
}
Expand Down
26 changes: 15 additions & 11 deletions cpp-package/README.md
@@ -1,16 +1,20 @@
# Brainflow
# BrainFlow

BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from BCI boards.
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors.

It provides a **uniform API for all supported boards**, it means that you can switch boards without any changes in code, also if you add your board to BrainFlow it will work with almost all applications built on top on BrainFlow from the box. Also there is **powerfull API to perform signal processing** which you can use even without BCI headset.
#### Advantages of BrainFlow:

BrainFlow has bindings for

* C++
* Java
* C#
* R
* Python
* and more
* powerful API with many features to simplify development
* Straightforward API for data acquisition
* Powerful API for signal filtering, denoising, downsampling...
* Development tools like Synthetic board, Streaming board, logging API
* easy to use
* BrainFlow has many bindings, you can choose programming language you like
* All programming languages provide the same API, so it's simple to switch
* API is uniform for all boards, it makes applications on top of BrainFlow almost board agnostic
* easy to support and extend
* Code to read data and to perform signal processing is implemented only once in C/C++, bindings just call C/C++ methods
* Powerful CI/CD system which runs integrations tests for each commit automatically using BrainFlow's Emulator
* Simplified process to add new boards and methods

## [BrainFlow Docs, Dev and User guides and other information](https://brainflow.readthedocs.io)
24 changes: 23 additions & 1 deletion cpp-package/src/board_shim.cpp
Expand Up @@ -263,6 +263,17 @@ int BoardShim::get_timestamp_channel (int board_id)
return timestamp_channel;
}

int BoardShim::get_battery_channel (int board_id)
{
int battery_channel = 0;
int res = ::get_battery_channel (board_id, &battery_channel);
if (res != STATUS_OK)
{
throw BrainFlowException ("failed get board info", res);
}
return battery_channel;
}

int BoardShim::get_num_rows (int board_id)
{
int num_rows = 0;
Expand Down Expand Up @@ -371,4 +382,15 @@ int *BoardShim::get_other_channels (int board_id, int *len)
throw BrainFlowException ("failed get board info", res);
}
return other_channels;
}
}

int *BoardShim::get_temperature_channels (int board_id, int *len)
{
int *temperature_channels = new int[MAX_CHANNELS];
int res = ::get_temperature_channels (board_id, temperature_channels, len);
if (res != STATUS_OK)
{
throw BrainFlowException ("failed get board info", res);
}
return temperature_channels;
}

0 comments on commit 83ee597

Please sign in to comment.