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

Method start_stream

src/board_controller/streaming_board.cpp:135–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135int StreamingBoard::start_stream (int buffer_size, const char *streamer_params)
136{
137 if (keep_alive)
138 {
139 safe_logger (spdlog::level::err, "Streaming thread already running");
140 return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR;
141 }
142 int res = prepare_for_acquisition (buffer_size, streamer_params);
143 if (res != (int)BrainFlowExitCodes::STATUS_OK)
144 {
145 return res;
146 }
147
148 keep_alive = true;
149 for (int i = 0; i < (int)clients.size (); i++)
150 {
151 streaming_threads.push_back (std::thread ([this, i] { this->read_thread (i); }));
152 }
153 return (int)BrainFlowExitCodes::STATUS_OK;
154}
155
156int StreamingBoard::stop_stream ()
157{

Callers

nothing calls this directly

Calls 1

read_threadMethod · 0.95

Tested by

no test coverage detected