diff --git a/src/board_controller/openbci/ganglion.cpp b/src/board_controller/openbci/ganglion.cpp index 123b9ce22..a21a8cd57 100644 --- a/src/board_controller/openbci/ganglion.cpp +++ b/src/board_controller/openbci/ganglion.cpp @@ -30,6 +30,7 @@ Ganglion::Ganglion (struct BrainFlowInputParams params) is_valid = true; } use_mac_addr = (params.mac_address.empty ()) ? false : true; + firmware = 0; is_streaming = false; keep_alive = false; initialized = false; @@ -554,6 +555,11 @@ void Ganglion::decompress_firmware_2 ( int Ganglion::config_board (std::string config, std::string &response) { + if (config == "get_firmware_version") + { + response = std::to_string (firmware); + return (int)BrainFlowExitCodes::STATUS_OK; + } const char *conf = config.c_str (); safe_logger (spdlog::level::debug, "Trying to config Ganglion with {}", conf); // need to pause, config and restart. I have no idea why it doesnt work if I restart it inside diff --git a/src/board_controller/openbci/ganglion_bglib/main.cpp b/src/board_controller/openbci/ganglion_bglib/main.cpp index 7f223e041..f19067311 100644 --- a/src/board_controller/openbci/ganglion_bglib/main.cpp +++ b/src/board_controller/openbci/ganglion_bglib/main.cpp @@ -24,7 +24,7 @@ namespace GanglionLib std::deque data_queue; SpinLock lock; volatile bd_addr connect_addr; - volatile uint8 firmware = 2; + volatile uint8 firmware = 0; volatile uint8 connection = -1; volatile uint16 ganglion_handle_start = 0; volatile uint16 ganglion_handle_end = 0; diff --git a/src/board_controller/openbci/ganglion_native.cpp b/src/board_controller/openbci/ganglion_native.cpp index 986b8b1ee..be57671d8 100644 --- a/src/board_controller/openbci/ganglion_native.cpp +++ b/src/board_controller/openbci/ganglion_native.cpp @@ -42,6 +42,7 @@ GanglionNative::GanglionNative (struct BrainFlowInputParams params) is_streaming = false; start_command = "b"; stop_command = "s"; + firmware = 0; } GanglionNative::~GanglionNative () @@ -316,6 +317,13 @@ int GanglionNative::release_session () int GanglionNative::config_board (std::string config, std::string &response) { + // todo do smth to unify available commands + // and make them more or less standard between devices + if (config == "get_firmware_version") + { + response = std::to_string (firmware); + return (int)BrainFlowExitCodes::STATUS_OK; + } return config_board (config); }