Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions .github/workflows/deploy_cpp_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
# compile and prepare everything
# need to build SimpleBLE outside from BrainFlow because they have different Windows System Versions
- name: Compile SimpleBLE ${{ matrix.build_type }} ${{ matrix.arch }} with MSVC runtime ${{ matrix.msvc_runtime }}
# need to build SimpleCBLE outside from BrainFlow because they have different Windows System Versions
- name: Compile SimpleCBLE ${{ matrix.build_type }} ${{ matrix.arch }} with MSVC runtime ${{ matrix.msvc_runtime }}
run: |
mkdir %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\%BUILD%_%RUNTIME%_%ARCH%
cd %GITHUB_WORKSPACE%\third_party\SimpleBLE\simpleble\%BUILD%_%RUNTIME%_%ARCH%
mkdir %GITHUB_WORKSPACE%\third_party\SimpleBLE\simplecble\%BUILD%_%RUNTIME%_%ARCH%
cd %GITHUB_WORKSPACE%\third_party\SimpleBLE\simplecble\%BUILD%_%RUNTIME%_%ARCH%
cmake -G "Visual Studio 17 2022" -A %ARCH% -DMSVC_RUNTIME=%RUNTIME% -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\artifacts\%ARCH%_%BUILD%_%RUNTIME%\ ..
cmake --build . --target install --config %BUILD% -j 2 --parallel 2
shell: cmd
Expand Down Expand Up @@ -75,12 +75,12 @@ jobs:
brew install ninja
fi
ninja --version
# build simpleble outside from brainflow because of different deployment targets
- name: Compile SimpleBLE MacOS
# build SimpleCBLE outside from brainflow because of different deployment targets
- name: Compile SimpleCBLE MacOS
if: (matrix.os == 'macos-14')
run: |
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
cmake -G Ninja -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/artifacts/macos_$BUILD -DCMAKE_BUILD_TYPE=$BUILD ..
ninja
ninja install
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: (matrix.os == 'ubuntu-latest')
run: |
sudo -H apt-get update -y
sudo -H apt-get install -y python3-setuptools python3-pygments libbluetooth-dev
sudo -H apt-get install -y python3-setuptools python3-pygments libbluetooth-dev libdbus-1-dev
env:
DEBIAN_FRONTEND: noninteractive
- name: Install Node
Expand Down Expand Up @@ -63,12 +63,12 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11.0.3
# build simpleble outside from brainflow because of different deployment targets
- name: Compile SimpleBLE MacOS
# build SimpleCBLE outside from brainflow because of different deployment targets
- name: Compile SimpleCBLE MacOS
if: (matrix.os == 'macos-14')
run: |
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simpleble/build
mkdir $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
cd $GITHUB_WORKSPACE/third_party/SimpleBLE/simplecble/build
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 ..
ninja
ninja install
Expand Down
8 changes: 4 additions & 4 deletions src/board_controller/ble_lib_board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
DLLLoader *BLELibBoard::dll_loader = NULL;
std::mutex BLELibBoard::mutex;
#else
#include "simpleble_c/adapter.h"
#include "simpleble_c/peripheral.h"
#include "simpleble_c/simpleble.h"
#include "simpleble_c/utils.h"
#include "simplecble/adapter.h"
#include "simplecble/peripheral.h"
#include "simplecble/simplecble.h"
#include "simplecble/utils.h"
#endif

BLELibBoard::BLELibBoard (int board_id, struct BrainFlowInputParams params)
Expand Down
4 changes: 2 additions & 2 deletions src/board_controller/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (BUILD_BLUETOOTH)
endif (BUILD_BLUETOOTH)

if (BUILD_BLE)
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simpleble)
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simplecble)
endif (BUILD_BLE)

add_library (
Expand Down Expand Up @@ -146,7 +146,7 @@ target_include_directories (
${CMAKE_CURRENT_SOURCE_DIR}/third_party/ant_neuro
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/ant_neuro/inc
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/enophone/inc
${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simpleble/include
${CMAKE_CURRENT_SOURCE_DIR}/third_party/SimpleBLE/simplecble/include
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/brainalive/inc
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/mentalab/inc
${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/emotibit/inc
Expand Down
2 changes: 1 addition & 1 deletion src/board_controller/inc/ble_lib_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "board.h"
#include "board_controller.h"
#include "runtime_dll_loader.h"
#include "simpleble_c/types.h"
#include "simplecble/types.h"


class BLELibBoard : public Board
Expand Down
35 changes: 35 additions & 0 deletions third_party/SimpleBLE/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
!docs-new/
!simpleble/include/
!dependencies/external/

docs-new/node_modules/
docs-new/.next/
docs-new/out/
docs-new/_doxygen/

.env*.local
.env.local

.vscode
.idea
**/*.swp
**/*.swo

.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

.git
.gitignore

**/Dockerfile*
**/docker-compose*

**/*.log

**/.cache
**/.parcel-cache
81 changes: 81 additions & 0 deletions third_party/SimpleBLE/.github/actions/build-dbus-full/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 'Build DBus'
description: 'Clone and build DBus'

inputs:
os:
description: "Runner OS"
default: ''
required: true
arch:
description: "Platform architecture"
default: ''
required: true

runs:
using: "composite"
steps:
- name: Install Dependencies
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
run: |
if [[ "${{ inputs.arch }}" == "x86" ]]; then
sudo -H apt-get remove -y libexpat1-dev:i386
else
sudo -H apt-get remove -y libexpat1-dev
fi

- name: Generate Hashes
id: hashes
shell: bash
# NOTE: Pinning libexpat to 2.7.0 as the exact version is not important.
# NOTE: Pinning DBus to 1.16.2 as the exact version is not important.
run: |
EXPAT_HASH=6d4ffe856df497ac2cae33537665c3fec7ec8a00
DBUS_HASH=958bf9db2100553bcd2fe2a854e1ebb42e886054
COMBINED_HASH="$EXPAT_HASH-$DBUS_HASH"
echo "expat_hash=$EXPAT_HASH" >> $GITHUB_OUTPUT
echo "dbus_hash=$DBUS_HASH" >> $GITHUB_OUTPUT
echo "combined_hash=$COMBINED_HASH" >> $GITHUB_OUTPUT

- name: Cache Linux Dependencies
id: cache-simpleble-linux-deps
uses: actions/cache@v4
with:
path: /tmp/install
key: expat-dbus-${{ inputs.os }}-${{ inputs.arch }}-${{ steps.hashes.outputs.combined_hash }}

- name: Build Expat
if: steps.cache-simpleble-linux-deps.outputs.cache-hit != 'true'
shell: bash
run: |
if [[ -d "/tmp/expat" ]]; then
echo "/tmp/expat already exists, skipping clone and build."
exit 0
fi
git clone https://github.com/libexpat/libexpat.git /tmp/expat
cd /tmp/expat/expat
git checkout ${{ steps.hashes.outputs.expat_hash }}
cmake -B build -DEXPAT_BUILD_DOCS=OFF -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF
cmake --build build --config Release --parallel 4
cmake --install build --prefix /tmp/install

- name: Build DBus
if: steps.cache-simpleble-linux-deps.outputs.cache-hit != 'true'
shell: bash
run: |
if [[ -d "/tmp/dbus" ]]; then
echo "/tmp/dbus already exists, skipping clone and build."
exit 0
fi
git clone https://gitlab.freedesktop.org/dbus/dbus.git /tmp/dbus
cd /tmp/dbus
git checkout ${{ steps.hashes.outputs.dbus_hash }}
cmake -B build -DDBUS_SESSION_SOCKET_DIR=/usr/local/var/run/dbus/system_bus_socket -DDBUS_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install -DCMAKE_PREFIX_PATH=/tmp/install
cmake --build build --config Release --parallel 4
cmake --install build --prefix /tmp/install

- name: Export Environment Variables
shell: bash
run: |
echo "CMAKE_PREFIX_PATH=/tmp/install" >> $GITHUB_ENV
63 changes: 0 additions & 63 deletions third_party/SimpleBLE/.github/actions/build-dbus/action.yml

This file was deleted.

43 changes: 0 additions & 43 deletions third_party/SimpleBLE/.github/actions/build-expat/action.yml

This file was deleted.

Loading
Loading