| 102 | } |
| 103 | |
| 104 | int 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 | |
| 130 | int Emotibit::stop_stream () |
| 131 | { |
nothing calls this directly
no test coverage detected