Skip to content

Commit

Permalink
Update Galea serial default setting and log gains
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacplotkin committed Feb 22, 2024
1 parent 15bae7e commit b9a7dfc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/board_controller/openbci/galea_serial_v4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int GaleaSerialV4::prepare_session ()

// set initial settings
std::string tmp;
std::string default_settings = "o"; // use demo mode with agnd
std::string default_settings = "d"; // use default mode
res = config_board (default_settings, tmp);
if (res != (int)BrainFlowExitCodes::STATUS_OK)
{
Expand Down Expand Up @@ -127,6 +127,23 @@ int GaleaSerialV4::config_board (std::string conf, std::string &response)
return res;
}

if (conf == "get_gains")
{
std::stringstream gains;

for (int i = 0; i < 20; i++)
{
gains << gain_tracker.get_gain_for_channel (i);
if (i < 19)
{
gains << ", ";
}
}
response = gains.str ();
safe_logger (spdlog::level::info, "gains for all channels: {}", response);
return (int)BrainFlowExitCodes::STATUS_OK;
}

if (gain_tracker.apply_config (conf) == (int)OpenBCICommandTypes::INVALID_COMMAND)
{
safe_logger (spdlog::level::warn, "invalid command: {}", conf.c_str ());
Expand Down

0 comments on commit b9a7dfc

Please sign in to comment.