Skip to content
Closed
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
1 change: 1 addition & 0 deletions docs/SupportedBoards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ Supported platforms:

Available commands:

- Get amplifier info: :code:`board.config_board("get_info")`, returns json-string with amplifier type, firmware version, serial number, available sampling rates, available reference ranges, available bipolar ranges, and power state.
- Set impedance mode: :code:`board.config_board("impedance_mode:1")`, mode 0 or 1.
- Set sampling rate: :code:`board.config_board("sampling_rate:500")`, for available values check docs from Ant Neuro.
- Set reference range: :code:`board.config_board("reference_range:1.0")`, for available values check docs from Ant Neuro.
Expand Down
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'))
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure what hapenned here, but isnt it already submitted?

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";
Copy link
Member

Choose a reason for hiding this comment

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

The same as here


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