MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / start_stream

Method start_stream

src/board_controller/neuromd/brainbit.cpp:279–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279int BrainBit::start_stream (int buffer_size, const char *streamer_params)
280{
281 if (is_streaming)
282 {
283 safe_logger (spdlog::level::err, "Streaming thread already running");
284 return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR;
285 }
286 int res = prepare_for_acquisition (buffer_size, streamer_params);
287 if (res != (int)BrainFlowExitCodes::STATUS_OK)
288 {
289 return res;
290 }
291
292 std::string command_start = "CommandStartSignal";
293 std::string tmp = "";
294 res = config_board (command_start, tmp);
295 if (res != (int)BrainFlowExitCodes::STATUS_OK)
296 {
297 return res;
298 }
299
300 keep_alive = true;
301 streaming_thread = std::thread ([this] { this->read_thread (); });
302 is_streaming = true;
303 return (int)BrainFlowExitCodes::STATUS_OK;
304}
305
306int BrainBit::stop_stream ()
307{

Callers

nothing calls this directly

Calls 2

read_threadMethod · 0.95
config_boardFunction · 0.50

Tested by

no test coverage detected