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

Method start_stream

src/board_controller/gtec/unicorn_board.cpp:94–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int 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
120int UnicornBoard::stop_stream ()
121{

Callers

nothing calls this directly

Calls 1

read_threadMethod · 0.95

Tested by

no test coverage detected