Skip to content

ANT Neuro SDK functions #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 5, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python_package/examples/tests/eego_impedances_and_eeg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import json

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds

Expand All @@ -7,6 +8,11 @@
board = BoardShim(BoardIds.ANT_NEURO_EE_411_BOARD, params) # 8 channel amplifier
board.prepare_session()

# Get amplifier info
info = json.loads(board.config_board('get_info'))
for key, value in info.items():
print(f" - {key}: {value}")

# Get impedance data
board.config_board('impedance_mode:1')
board.start_stream()
Expand Down
20 changes: 18 additions & 2 deletions src/board_controller/ant_neuro/ant_neuro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "eemagine/sdk/wrapper.h"

using namespace eemagine::sdk;
using json = nlohmann::json;


AntNeuroBoard::AntNeuroBoard (int board_id, struct BrainFlowInputParams params)
Expand Down Expand Up @@ -346,6 +347,7 @@ int AntNeuroBoard::config_board (std::string config, std::string &response)
std::string rv_prefix = "reference_range:";
std::string bv_prefix = "bipolar_range:";
std::string mode_prefix = "impedance_mode:";
std::string get_info = "get_info";

if (config.find (prefix) != std::string::npos)
{
Expand Down Expand Up @@ -471,8 +473,22 @@ int AntNeuroBoard::config_board (std::string config, std::string &response)
return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
}
}

safe_logger (spdlog::level::err, "format is '{}value'", prefix.c_str ());
else if (config == get_info) // return stringified JSON with info from ANT board
{
json j;
j["type"] = amp->getType ();
j["firmware_version"] = amp->getFirmwareVersion ();
j["serial_number"] = amp->getSerialNumber ();
j["sampling_rates"] = amp->getSamplingRatesAvailable ();
j["reference_ranges"] = amp->getReferenceRangesAvailable ();
j["bipolar_ranges"] = amp->getBipolarRangesAvailable ();
amplifier::power_state ps = amp->getPowerState ();
j["power_state"] = {{"is_powered", ps.is_powered}, {"is_charging", ps.is_charging},
{"charging_level", ps.charging_level}};
response = j.dump ();
return (int)BrainFlowExitCodes::STATUS_OK;
}
safe_logger (spdlog::level::err, "format is '{}value' or 'get_info'", prefix.c_str ());
return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
}

Expand Down
Loading