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

Function main

cpp_package/examples/get_data/src/get_data_muse.cpp:18–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17
18int main (int argc, char *argv[])
19{
20 BoardShim::enable_dev_board_logger ();
21
22 struct BrainFlowInputParams params;
23 int board_id = (int)BoardIds::MUSE_S_BOARD;
24 int res = 0;
25
26 BoardShim *board = new BoardShim (board_id, params);
27
28 try
29 {
30 board->prepare_session ();
31 board->config_board ("p61");
32 board->add_streamer ("file://streamer_default.csv:w");
33 board->add_streamer ("file://streamer_aux.csv:w", (int)BrainFlowPresets::AUXILIARY_PRESET);
34 board->add_streamer ("file://streamer_anc.csv:w", (int)BrainFlowPresets::ANCILLARY_PRESET);
35 board->start_stream ();
36
37#ifdef _WIN32
38 Sleep (10000);
39#else
40 sleep (10);
41#endif
42 board->stop_stream ();
43 board->release_session ();
44 }
45 catch (const BrainFlowException &err)
46 {
47 BoardShim::log_message ((int)LogLevels::LEVEL_ERROR, err.what ());
48 res = err.exit_code;
49 if (board->is_prepared ())
50 {
51 board->release_session ();
52 }
53 }
54
55 delete board;
56
57 return res;
58}

Callers

nothing calls this directly

Calls 11

enable_dev_board_loggerFunction · 0.85
whatMethod · 0.80
prepare_sessionMethod · 0.65
config_boardMethod · 0.65
add_streamerMethod · 0.65
start_streamMethod · 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