Skip to content

Add optional ANT Neuro EDX support#799

Open
caleycaleycaley wants to merge 6 commits intobrainflow-dev:masterfrom
caleycaleycaley:add-ant-edx-pr
Open

Add optional ANT Neuro EDX support#799
caleycaleycaley wants to merge 6 commits intobrainflow-dev:masterfrom
caleycaleycaley:add-ant-edx-pr

Conversation

@caleycaleycaley
Copy link
Copy Markdown

Summary
This PR adds optional ANT Neuro EDX support to BrainFlow behind a dedicated build flag.
It introduces EDX board IDs for supported ANT amplifiers, adds the native EDX board controller implementation, wires the new IDs across bindings, and documents both build and runtime usage.

What’s included
add optional BUILD_ANT_EDX CMake flag
add ANT Neuro EDX native implementation and protobuf/gRPC wiring
add explicit EDX board IDs for supported ANT amplifiers
add EDX protocol support and board descriptors
update Python, Java, C#, Node, Julia, MATLAB, and Rust bindings with the new board IDs
document CMake build requirements for EDX
document runtime usage for direct EDX board connections
add Python example tests for direct EDX lifecycle, impedance, and mode transitions
Design notes
EDX support is opt-in and does not affect default builds unless BUILD_ANT_EDX=ON
explicit EDX board IDs are used.
Validation
Built successfully:
Live device validation against a real EE511 on EDX (localhost:3390) passed:
python_package/examples/tests/edx_full_lifecycle.py
python_package/examples/tests/edx_impedance.py
python_package/examples/tests/edx_mode_transitions.py

@caleycaleycaley caleycaleycaley marked this pull request as draft March 20, 2026 06:12
@caleycaleycaley caleycaleycaley marked this pull request as ready for review March 20, 2026 06:12
UDP = 1,
TCP = 2
TCP = 2,
EDX = 3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not be here, its a public enum to specify which protocol to use if device supports multiple. This one supports just one

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346 . removed EDX from the public protocol enum; EDX is selected by explicit board ID, not by ip_protocol.

}
string descr_str = System.Text.Encoding.UTF8.GetString (str, 0, len[0]);
var ms = new MemoryStream (Encoding.UTF8.GetBytes (descr_str));
var serializer = new DataContractJsonSerializer (typeof (T));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it complains due to removed using above, why is it removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346 .
accidental, now restored

cd build-edx
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_ANT_EDX=ON -DMSVC_RUNTIME=dynamic -DCMAKE_INSTALL_PREFIX=../installed-edx ..
cmake --build . --target install --config Release -j 2 --parallel 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it here? just add a cmake option and build.py option and set a default for this option properly, I dont think it requires mentioning it here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346 .
reduced to a short note and kept the main change in CMake/build flow instead


.. compound::

EDX profile on Linux example: ::
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346 .
removed the extra profile/example block and keeps docs shorter

board.config_board("reference_range:0.15")?;
board.config_board("bipolar_range:2.5")?;
board.start_stream(45000, "")?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its too much, just one example is enough

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346 .
one concise example per language

case BoardIds::ANT_NEURO_EE_511_EDX_BOARD:
board = std::shared_ptr<Board> (new AntNeuroEdxBoard (board_id, params));
break;
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is if ant edx board is selected but dyn lib is built wo flag it will just return unsupported board error, instead it would be good to print in logs how binary should be compiled to use these boards

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346. added an #else path in board_controller.cpp so EDX board ids log a clear message telling to rebuild with -DBUILD_ANT_EDX=ON.

{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}},
{"emg_channels", {25, 26, 27, 28}},
{"resistance_channels", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 30}},
{"resistance_channels", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can put resistance channels to its own preset

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 5e6956f5. impedance data is now available through ancillary, but kept the default preset unchanged for compatibility with legacy ANT board consumers.

{"emg_channels", {25, 26, 27, 28}},
{"resistance_channels", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 29, 30}},
{"resistance_channels", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}},
{"ref_resistance_channels", {29}},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw there is no public method exposing these 2, the only way to access them will be get_board_descr, although I think its fine

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood. these are 'nice to have', for now access is via get_board_descr, fine to keep like that in this PR.

if (NOT Protobuf_FOUND)
find_package (Protobuf REQUIRED)
endif ()
find_package (gRPC CONFIG REQUIRED)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont just use find try to install it from cmake instead

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or package to third_patry folder

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this PR we kept dependency installation explicit and did not add auto-install logic. build now fails fast with clear install instructions when protobuf / gRPC are missing.
Good enough?

UDP = 1,
TCP = 2
TCP = 2,
EDX = 3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1af37346. removed

caleycaleycaley added a commit to caleycaleycaley/brainflow that referenced this pull request Mar 29, 2026
… EDX board

- Remove EDX=3 from IpProtocolTypes across all 8 language bindings (EDX uses
  gRPC only, not a generic IP protocol variant)
- Restore accidentally removed `using System.Runtime.Serialization.Json;` in
  board_shim.cs (fixes DataContractJsonSerializer compile error)
- Replace verbose EDX build docs with a single brief CMake note; emit
  FATAL_ERROR with install instructions when gRPC/protobuf not found
- Collapse SupportedBoards.rst EDX examples to one per language; remove
  ip_protocol and master_board references; add RX-300 subsection
- Add #else block in board_controller.cpp so EDX board IDs return a clear
  error when BrainFlow is built without -DBUILD_ANT_EDX=ON
- Separate impedance channels into ancillary preset in clone_ant_edx_board;
  default preset now contains only EEG/streaming channels
- Strip params.master_board cross-check from ant_neuro_edx.cpp (no longer used)
- Add ANT_NEURO_RX_300_EDX_BOARD (id=81) as a self-contained EDX-only board
  with direct JSON config (4 EEG + 4 EMG + 17 aux channels, 500 Hz); no
  hidden legacy master board entry
- Make board IDs contiguous: close gap at 67 by shifting EDX series from
  68-82 down to 67-81; update LAST sentinel in all bindings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove EDX=3 from IpProtocolTypes across all 8 language bindings
  (EDX uses gRPC only; not a generic IP protocol variant)
- Restore accidentally removed using System.Runtime.Serialization.Json
  in board_shim.cs (fixes DataContractJsonSerializer compile error)
- Replace verbose EDX build steps in BuildBrainFlow.rst with a brief note;
  emit FATAL_ERROR with install instructions when gRPC/protobuf not found
- Collapse SupportedBoards.rst EDX examples to one per language; remove
  ip_protocol and master_board references from docs
- Add #else block in board_controller.cpp so EDX board IDs log a clear
  error when BrainFlow is built without -DBUILD_ANT_EDX=ON
- Separate impedance channels into ancillary preset in clone_ant_edx_board;
  default preset now contains only EEG/streaming channels
- Strip params.master_board cross-check from ant_neuro_edx.cpp
- Make board IDs contiguous: shift EDX series from 68-82 to 67-80,
  close gap after NEUROPAWN_KNIGHT_BOARD_IMU; update LAST sentinel in all bindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants