Skip to content

Commit 07851d5

Browse files
committed
Merge origin/master into muse_anthena
2 parents a1d5c96 + 5807adb commit 07851d5

129 files changed

Lines changed: 1972 additions & 3641 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/conan.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
uses: actions/checkout@v2
1818
- name: Add msbuild to PATH
1919
uses: microsoft/setup-msbuild@v1.0.2
20+
- name: install Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.10"
2024
- name: Get Conan
2125
uses: turtlebrowser/get-conan@main
2226
with:

.github/workflows/deploy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ jobs:
2828
# Install Dependencies
2929
- name: Clone Repository
3030
uses: actions/checkout@v2
31+
- name: Set up Python
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.10'
3135
- name: Install Python Deploy Tools
3236
run: |
33-
python -m pip install wheel
34-
python -m pip install twine
35-
python -m pip install awscli
37+
python -m pip install --upgrade pip
38+
python -m pip install setuptools wheel twine awscli
3639
shell: cmd
3740
- name: Install Node
3841
uses: actions/setup-node@v3

.github/workflows/deploy_cpp_libs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
max-parallel: 16
6060
matrix:
6161
build_type: [Release, Debug]
62-
os: [ubuntu-latest, macos-13]
62+
os: [ubuntu-latest, macos-14]
6363

6464
steps:
6565
- name: Clone Repository
@@ -69,13 +69,13 @@ jobs:
6969
with:
7070
cmake-version: '3.21.x'
7171
- name: Install Ninja
72-
if: (matrix.os == 'macos-13')
72+
if: (matrix.os == 'macos-14')
7373
uses: seanmiddleditch/gha-setup-ninja@master
7474
with:
7575
version: 1.10.2
7676
# build simpleble outside from brainflow because of different deployment targets
7777
- name: Compile SimpleBLE MacOS
78-
if: (matrix.os == 'macos-13')
78+
if: (matrix.os == 'macos-14')
7979
run: |
8080
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
8181
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
@@ -86,7 +86,7 @@ jobs:
8686
env:
8787
BUILD: ${{ matrix.build_type }}
8888
- name: Compile BrainFlow for MacOS
89-
if: (matrix.os == 'macos-13')
89+
if: (matrix.os == 'macos-14')
9090
run: |
9191
mkdir $GITHUB_WORKSPACE/build
9292
cd $GITHUB_WORKSPACE/build

.github/workflows/run_unix.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
max-parallel: 4
1212
matrix:
13-
os: [ubuntu-latest, macos-13]
13+
os: [ubuntu-latest, macos-14]
1414

1515
steps:
1616
# compile and prepare env
@@ -44,14 +44,15 @@ jobs:
4444
run: |
4545
npm install -g ts-node
4646
- name: Install Ninja
47-
if: (matrix.os == 'macos-13')
47+
if: (matrix.os == 'macos-14')
4848
uses: seanmiddleditch/gha-setup-ninja@master
4949
with:
5050
version: 1.10.2
5151
- name: Install Julia
52-
uses: julia-actions/setup-julia@v1
52+
uses: julia-actions/setup-julia@v2
5353
with:
54-
version: 1.3.1
54+
version: '1'
55+
arch: 'default'
5556
- name: Setup Cmake
5657
uses: jwlawson/actions-setup-cmake@v1.13
5758
with:
@@ -62,15 +63,15 @@ jobs:
6263
java-version: 11.0.3
6364
# build simpleble outside from brainflow because of different deployment targets
6465
- name: Compile SimpleBLE MacOS
65-
if: (matrix.os == 'macos-13')
66+
if: (matrix.os == 'macos-14')
6667
run: |
6768
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
6869
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
6970
cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/installed -DCMAKE_BUILD_TYPE=Release ..
7071
ninja
7172
ninja install
7273
- name: Compile BrainFlow MacOS
73-
if: (matrix.os == 'macos-13')
74+
if: (matrix.os == 'macos-14')
7475
run: |
7576
mkdir $GITHUB_WORKSPACE/build
7677
cd $GITHUB_WORKSPACE/build
@@ -153,7 +154,7 @@ jobs:
153154
- name: Run unit tests
154155
run: $GITHUB_WORKSPACE/build/tests/brainflow_tests
155156
- name: Synthetic C# Test MacOS
156-
if: (matrix.os == 'macos-13')
157+
if: (matrix.os == 'macos-14')
157158
run: |
158159
cd $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0
159160
cp $GITHUB_WORKSPACE/installed/lib/libBoardController.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/brainflow_get_data/bin/Release/net7.0/
@@ -163,7 +164,7 @@ jobs:
163164
LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib
164165
DYLD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib
165166
- name: EEG Metrics C# Test MacOS
166-
if: (matrix.os == 'macos-13')
167+
if: (matrix.os == 'macos-14')
167168
run: |
168169
cd $GITHUB_WORKSPACE/csharp_package/brainflow/examples/eeg_metrics/bin/Release/net7.0
169170
cp $GITHUB_WORKSPACE/installed/lib/libBoardController.dylib $GITHUB_WORKSPACE/csharp_package/brainflow/examples/eeg_metrics/bin/Release/net7.0/
@@ -412,7 +413,7 @@ jobs:
412413
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
413414
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
414415
- name: Push Libraries MacOS Dev
415-
if: ${{ github.event_name == 'push' && matrix.os == 'macos-13' && github.repository == 'brainflow-dev/brainflow' }}
416+
if: ${{ github.event_name == 'push' && matrix.os == 'macos-14' && github.repository == 'brainflow-dev/brainflow' }}
416417
run: |
417418
aws s3 cp $GITHUB_WORKSPACE/installed/lib/ s3://brainflow/$GITHUB_SHA/macos_release --recursive
418419
env:

.github/workflows/run_windows.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
uses: actions/setup-dotnet@v3
2222
with:
2323
dotnet-version: '7.0.x'
24+
- name: Setup Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.11'
2428
- name: Set Version
2529
id: version
2630
run: if ("tag" -eq $Env:GITHUB_REF_TYPE) { echo "::set-output name=version::$Env:GITHUB_REF_NAME" } else { echo "::set-output name=version::$Env:GITHUB_SHA" }
@@ -67,6 +71,7 @@ jobs:
6771
shell: cmd
6872
- name: Install Emulator
6973
run: |
74+
pip install setuptools
7075
pip install %GITHUB_WORKSPACE%\emulator\
7176
cd %GITHUB_WORKSPACE%
7277
.\emulator\brainflow_emulator\com0com\certmgr.exe /add %GITHUB_WORKSPACE%\emulator\brainflow_emulator\com0com\com0com.cer /s /r localMachine root

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
x64/
2121
x86/
2222
bld/
23+
build/
2324
[Bb]in/
2425
[Oo]bj/
2526
[Ll]og/

.readthedocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.8"
11+
python: "3.9"
1212
# You can also specify other tool versions:
1313
# nodejs: "20"
1414
# rust: "1.70"
@@ -32,4 +32,4 @@ formats:
3232
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3333
python:
3434
install:
35-
- requirements: docs/requirements.txt
35+
- requirements: docs/requirements.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The BrainFlow project strives to abide by generally accepted best practices in o
4949
| Build Type | Status |
5050
|:---------------------------: |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
5151
| Windows Tests | [![Run Windows](https://github.com/brainflow-dev/brainflow/actions/workflows/run_windows.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/run_windows.yml) |
52-
| Unix(Linix and MacOS) Tests | [![Run Unix](https://github.com/brainflow-dev/brainflow/actions/workflows/run_unix.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/run_unix.yml) |
52+
| Unix(Linux and MacOS) Tests | [![Run Unix](https://github.com/brainflow-dev/brainflow/actions/workflows/run_unix.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/run_unix.yml) |
5353
| Android Tests | [![Run Android NDK](https://github.com/brainflow-dev/brainflow/actions/workflows/run_android.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/run_android.yml) |
5454
| Alpine Tests | [![Run Alpine](https://github.com/brainflow-dev/brainflow/actions/workflows/run_alpine.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/run_alpine.yml) |
5555
| Valgrind Tests | [![Run Valgrind](https://github.com/brainflow-dev/brainflow/actions/workflows/valgrind.yml/badge.svg?branch=master)](https://github.com/brainflow-dev/brainflow/actions/workflows/valgrind.yml) |

cpp_package/src/board_shim.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ std::string BoardShim::config_board (std::string config)
235235
int response_len = 0;
236236
char response[8192];
237237
int res = ::config_board (
238-
config.c_str (), response, &response_len, board_id, serialized_params.c_str ());
238+
config.c_str (), response, &response_len, sizeof (response), board_id,
239+
serialized_params.c_str ());
239240
if (res != (int)BrainFlowExitCodes::STATUS_OK)
240241
{
241242
throw BrainFlowException ("failed to config board", res);
@@ -281,6 +282,18 @@ int BoardShim::get_board_id ()
281282
return master_board_id;
282283
}
283284

285+
int BoardShim::get_board_sampling_rate (int preset)
286+
{
287+
int sampling_rate = -1;
288+
int res =
289+
::get_board_sampling_rate (preset, &sampling_rate, board_id, serialized_params.c_str ());
290+
if (res != (int)BrainFlowExitCodes::STATUS_OK)
291+
{
292+
throw BrainFlowException ("failed to get board sampling rate", res);
293+
}
294+
return sampling_rate;
295+
}
296+
284297
//////////////////////////////////////////
285298
///////////// data desc methods //////////
286299
//////////////////////////////////////////
@@ -289,7 +302,8 @@ json BoardShim::get_board_descr (int board_id, int preset)
289302
{
290303
char board_descr_str[16000];
291304
int string_len = 0;
292-
int res = ::get_board_descr (board_id, preset, board_descr_str, &string_len);
305+
int res =
306+
::get_board_descr (board_id, preset, board_descr_str, &string_len, sizeof (board_descr_str));
293307
if (res != (int)BrainFlowExitCodes::STATUS_OK)
294308
{
295309
throw BrainFlowException ("failed to get board info", res);
@@ -368,7 +382,7 @@ std::vector<std::string> BoardShim::get_eeg_names (int board_id, int preset)
368382
{
369383
char eeg_names[4096];
370384
int string_len = 0;
371-
int res = ::get_eeg_names (board_id, preset, eeg_names, &string_len);
385+
int res = ::get_eeg_names (board_id, preset, eeg_names, &string_len, sizeof (eeg_names));
372386
if (res != (int)BrainFlowExitCodes::STATUS_OK)
373387
{
374388
throw BrainFlowException ("failed to get board info", res);
@@ -401,7 +415,7 @@ std::string BoardShim::get_device_name (int board_id, int preset)
401415
{
402416
char name[4096];
403417
int string_len = 0;
404-
int res = ::get_device_name (board_id, preset, name, &string_len);
418+
int res = ::get_device_name (board_id, preset, name, &string_len, sizeof (name));
405419
if (res != (int)BrainFlowExitCodes::STATUS_OK)
406420
{
407421
throw BrainFlowException ("failed to get board info", res);
@@ -602,4 +616,4 @@ std::string BoardShim::get_version ()
602616
std::string verion_str (version, string_len);
603617

604618
return verion_str;
605-
}
619+
}

cpp_package/src/inc/board_shim.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ class BoardShim
255255
int num_samples, int preset = (int)BrainFlowPresets::DEFAULT_PRESET);
256256
/// Get board id, for some boards can be different than provided (playback, streaming)
257257
int get_board_id ();
258+
/// get actual sampling rate for prepared board session
259+
int get_board_sampling_rate (int preset = (int)BrainFlowPresets::DEFAULT_PRESET);
258260
/// get number of packages in ringbuffer
259261
int get_board_data_count (int preset = (int)BrainFlowPresets::DEFAULT_PRESET);
260262
/// get all collected data and flush it from internal buffer

0 commit comments

Comments
 (0)