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

Method start_stream

src/board_controller/emotibit/emotibit.cpp:104–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104int Emotibit::start_stream (int buffer_size, const char *streamer_params)
105{
106 if (!initialized)
107 {
108 safe_logger (spdlog::level::err, "You need to call prepare_session before config_board");
109 return (int)BrainFlowExitCodes::BOARD_NOT_CREATED_ERROR;
110 }
111 if (keep_alive)
112 {
113 safe_logger (spdlog::level::err, "Streaming thread already running");
114 return (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR;
115 }
116 int res = prepare_for_acquisition (buffer_size, streamer_params);
117 if (res != (int)BrainFlowExitCodes::STATUS_OK)
118 {
119 return res;
120 }
121 res = send_control_msg (MODE_NORMAL_POWER);
122 if (res == (int)BrainFlowExitCodes::STATUS_OK)
123 {
124 keep_alive = true;
125 streaming_thread = std::thread ([this] { this->read_thread (); });
126 }
127 return (int)BrainFlowExitCodes::STATUS_OK;
128}
129
130int Emotibit::stop_stream ()
131{

Callers

nothing calls this directly

Calls 1

read_threadMethod · 0.95

Tested by

no test coverage detected