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

Method prepare_session

src/board_controller/gtec/unicorn_board.cpp:61–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61int UnicornBoard::prepare_session ()
62{
63 if (initialized)
64 {
65 safe_logger (spdlog::level::info, "Session is already prepared");
66 return (int)BrainFlowExitCodes::STATUS_OK;
67 }
68
69 if (!dll_loader->load_library ())
70 {
71 safe_logger (spdlog::level::err, "Failed to load library");
72 return (int)BrainFlowExitCodes::GENERAL_ERROR;
73 }
74 safe_logger (spdlog::level::debug, "Library is loaded");
75
76 func_get_data = (int (*) (UNICORN_HANDLE, uint32_t, float *, uint32_t))dll_loader->get_address (
77 "UNICORN_GetData");
78 if (func_get_data == NULL)
79 {
80 safe_logger (spdlog::level::err, "failed to get function address for UNICORN_GetData");
81 return (int)BrainFlowExitCodes::GENERAL_ERROR;
82 }
83
84 int res = call_open ();
85 if (res != (int)BrainFlowExitCodes::STATUS_OK)
86 {
87 return res;
88 }
89
90 initialized = true;
91 return (int)BrainFlowExitCodes::STATUS_OK;
92}
93
94int UnicornBoard::start_stream (int buffer_size, const char *streamer_params)
95{

Callers

nothing calls this directly

Calls 2

load_libraryMethod · 0.80
get_addressMethod · 0.45

Tested by

no test coverage detected