Skip to content

Commit 587c0e5

Browse files
committed
Remove socket code from PIEEGBoard and restructure periphery inclusion
- Removed socket-related code from PIEEGBoard to adhere to high-level API usage for data streaming. - Moved the c_periphery library to the third_party folder. - Updated CMakeLists and build.cmake to conditionally include and link periphery only when needed. - Removed unnecessary 'c' and 'm' libraries from the target_link_libraries. - Removed the emulator script and unnecessary examples from the PR.
1 parent 29e575b commit 587c0e5

Some content is hidden

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

51 files changed

+17
-322
lines changed

CMakeLists.txt

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ set(TARGETS_EXPORT_NAME brainflowTargets)
1616
set(PACKAGE_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
1717
set(PACKAGE_INC_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/inc)
1818

19-
# Set the Android NDK path
20-
if(DEFINED ENV{ANDROID_NDK_HOME})
21-
set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME})
22-
endif()
23-
24-
if(ANDROID)
25-
if(NOT DEFINED ANDROID_ABI)
26-
message(FATAL_ERROR "ANDROID_ABI is not set")
27-
endif()
28-
set(CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI})
29-
message(STATUS "Building for Android ABI: ${ANDROID_ABI}")
30-
endif()
31-
32-
list(LENGTH ANDROID_ABI ABI_COUNT)
33-
if(ABI_COUNT GREATER 1)
34-
message(FATAL_ERROR "ANDROID_ABI should only contain one architecture at a time: ${ANDROID_ABI}")
35-
endif()
36-
37-
if(ANDROID)
38-
set(CMAKE_TOOLCHAIN_FILE ${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake)
39-
endif()
40-
4119
option(USE_LIBFTDI "USE_LIBFTDI" OFF)
4220
option(USE_OPENMP "USE_OPENMP" OFF)
4321
option(WARNINGS_AS_ERRORS "WARNINGS_AS_ERRORS" OFF)
@@ -61,10 +39,6 @@ if(WARNINGS_AS_ERRORS)
6139
endif()
6240
endif()
6341

64-
add_subdirectory(src/board_controller/pieeg/inc/periphery)
65-
66-
67-
# Include other components
6842
include(${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/build.cmake)
6943
include(${CMAKE_CURRENT_SOURCE_DIR}/src/data_handler/build.cmake)
7044
include(${CMAKE_CURRENT_SOURCE_DIR}/src/ml/build.cmake)

emulator/brainflow_emulator/pieeg_emulator.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

python_package/brainflow/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
from brainflow.exit_codes import *
33
from brainflow.data_filter import *
44
from brainflow.ml_model import *
5-
from brainflow.utils import *
6-
7-
__version__ = "0.0.1"
5+
from brainflow.utils import *

python_package/examples/tests/pieeg_client.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

python_package/examples/tests/pieeg_sever.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/board_controller/build.cmake

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ if (BUILD_OYMOTION_SDK)
9797
include (${CMAKE_CURRENT_SOURCE_DIR}/third_party/gForceSDKCXX/build.cmake)
9898
endif (BUILD_OYMOTION_SDK)
9999

100-
# Link standard libraries conditionally
101100
if (BUILD_BLUETOOTH)
102-
if (!ANDROID)
101+
if (NOT ANDROID)
103102
include (${CMAKE_CURRENT_SOURCE_DIR}/src/utils/bluetooth/build.cmake)
104-
endif (!ANDROID)
103+
endif (NOT ANDROID)
105104
endif (BUILD_BLUETOOTH)
106105

107106
if (BUILD_BLE)
@@ -150,27 +149,27 @@ target_include_directories (
150149
target_compile_definitions(${BOARD_CONTROLLER_NAME} PRIVATE NOMINMAX BRAINFLOW_VERSION=${BRAINFLOW_VERSION})
151150

152151
set_target_properties (${BOARD_CONTROLLER_NAME}
153-
PROPERTIES
154-
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
155-
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
156-
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
152+
PROPERTIES
153+
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
154+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
155+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/compiled
157156
)
158157

159158
find_package(Threads REQUIRED)
160159

161160
if (ANDROID)
162-
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE log android c m dl)
161+
find_library(log-lib log)
162+
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE ${log-lib})
163163
else()
164164
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE pthread dl)
165-
endif(ANDROID)
166-
167-
target_compile_definitions(BoardController PRIVATE USE_PERIPHERY)
168-
169-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/pieeg/inc/periphery)
170-
171-
set_target_properties(periphery PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/board_controller/pieeg/inc/periphery/libperiphery.a)
165+
endif (ANDROID)
172166

173-
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE periphery c m ${CMAKE_THREAD_LIBS_INIT} dl)
167+
if (BUILD_PERIPHERY)
168+
target_compile_definitions(BoardController PRIVATE USE_PERIPHERY)
169+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/periphery)
170+
set_target_properties(periphery PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/third_party/periphery/libperiphery.a)
171+
target_link_libraries(${BOARD_CONTROLLER_NAME} PRIVATE periphery ${CMAKE_THREAD_LIBS_INIT} dl)
172+
endif (BUILD_PERIPHERY)
174173

175174
if (USE_LIBFTDI)
176175
find_package (LibFTDI1 NO_MODULE)
@@ -207,7 +206,6 @@ if (MSVC)
207206
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/inc/brainflow_constants.h" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/inc/brainflow_constants.h"
208207
)
209208
endif (MSVC)
210-
211209
if (UNIX AND NOT ANDROID)
212210
add_custom_command (TARGET ${BOARD_CONTROLLER_NAME} POST_BUILD
213211
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${BOARD_CONTROLLER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/nodejs_package/brainflow/lib/${BOARD_CONTROLLER_COMPILED_NAME}"
@@ -251,7 +249,7 @@ if (ANDROID)
251249
endif (ANDROID)
252250

253251
if (UNIX AND NOT ANDROID)
254-
target_link_libraries (${BOARD_CONTROLLER_NAME} PRIVATE pthread dl m c)
252+
target_link_libraries (${BOARD_CONTROLLER_NAME} PRIVATE pthread dl)
255253
endif (UNIX AND NOT ANDROID)
256254

257255
install (

0 commit comments

Comments
 (0)