| 45 | } |
| 46 | |
| 47 | int OpenBCISerialBoard::config_board (std::string config, std::string &response) |
| 48 | { |
| 49 | if (!initialized) |
| 50 | { |
| 51 | return (int)BrainFlowExitCodes::BOARD_NOT_READY_ERROR; |
| 52 | } |
| 53 | int res = (int)BrainFlowExitCodes::STATUS_OK; |
| 54 | if (is_streaming) |
| 55 | { |
| 56 | safe_logger (spdlog::level::warn, |
| 57 | "You are changing board params during streaming, it may lead to sync mismatch between " |
| 58 | "data acquisition thread and device"); |
| 59 | res = send_to_board (config.c_str ()); |
| 60 | } |
| 61 | else |
| 62 | { |
| 63 | // read response if streaming is not running |
| 64 | res = send_to_board (config.c_str (), response); |
| 65 | } |
| 66 | |
| 67 | if (res == (int)BrainFlowExitCodes::STATUS_OK) |
| 68 | { |
| 69 | track_openbci_sampling_rate (board_id, config, current_sampling_rate); |
| 70 | } |
| 71 | return res; |
| 72 | } |
| 73 | |
| 74 | int OpenBCISerialBoard::send_to_board (const char *msg) |
| 75 | { |
nothing calls this directly
no test coverage detected