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

Function main

cpp_package/examples/get_data/src/multiple_streamers.cpp:14–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13
14int main (int argc, char *argv[])
15{
16 BoardShim::enable_dev_board_logger ();
17
18 struct BrainFlowInputParams params;
19 int board_id = (int)BoardIds::SYNTHETIC_BOARD;
20 int res = 0;
21
22 BoardShim *board = new BoardShim (board_id, params);
23
24 try
25 {
26 board->prepare_session ();
27 board->add_streamer ("file://streamer_default_1.csv:w");
28 board->add_streamer ("file://streamer_default_2.csv:w");
29 board->add_streamer (
30 "file://streamer_aux_1.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET);
31 board->add_streamer (
32 "file://streamer_aux_2.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET);
33 board->start_stream ();
34
35#ifdef _WIN32
36 Sleep (5000);
37#else
38 sleep (5);
39#endif
40 board->delete_streamer (
41 "file://streamer_aux_2.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET);
42
43#ifdef _WIN32
44 Sleep (5000);
45#else
46 sleep (5);
47#endif
48
49 board->stop_stream ();
50 board->release_session ();
51 }
52 catch (const BrainFlowException &err)
53 {
54 BoardShim::log_message ((int)LogLevels::LEVEL_ERROR, err.what ());
55 res = err.exit_code;
56 if (board->is_prepared ())
57 {
58 board->release_session ();
59 }
60 }
61
62 delete board;
63
64 return res;
65}

Callers

nothing calls this directly

Calls 11

enable_dev_board_loggerFunction · 0.85
whatMethod · 0.80
prepare_sessionMethod · 0.65
add_streamerMethod · 0.65
start_streamMethod · 0.65
delete_streamerMethod · 0.65
stop_streamMethod · 0.65
release_sessionMethod · 0.65
is_preparedMethod · 0.65
sleepFunction · 0.50
log_messageFunction · 0.50

Tested by

no test coverage detected