| 92 | } |
| 93 | |
| 94 | int UnicornBoard::start_stream (int buffer_size, const char *streamer_params) |
| 95 | { |
| 96 | if (is_streaming) |
| 97 | { |
| 98 | safe_logger (spdlog::level::err, "Streaming thread already running"); |
| 99 | return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR; |
| 100 | } |
| 101 | |
| 102 | int res = prepare_for_acquisition (buffer_size, streamer_params); |
| 103 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 104 | { |
| 105 | return res; |
| 106 | } |
| 107 | |
| 108 | res = call_start (); |
| 109 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 110 | { |
| 111 | return res; |
| 112 | } |
| 113 | |
| 114 | keep_alive = true; |
| 115 | streaming_thread = std::thread ([this] { this->read_thread (); }); |
| 116 | is_streaming = true; |
| 117 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 118 | } |
| 119 | |
| 120 | int UnicornBoard::stop_stream () |
| 121 | { |
nothing calls this directly
no test coverage detected