| 20 | } |
| 21 | |
| 22 | int DynLibBoard::prepare_session () |
| 23 | { |
| 24 | if (initialized) |
| 25 | { |
| 26 | safe_logger (spdlog::level::info, "Session is already prepared"); |
| 27 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 28 | } |
| 29 | if (params.timeout <= 0) |
| 30 | { |
| 31 | params.timeout = 5; |
| 32 | } |
| 33 | |
| 34 | dll_loader = new DLLLoader (get_lib_name ().c_str ()); |
| 35 | if (!dll_loader->load_library ()) |
| 36 | { |
| 37 | safe_logger (spdlog::level::err, "Failed to load library"); |
| 38 | delete dll_loader; |
| 39 | dll_loader = NULL; |
| 40 | return (int)BrainFlowExitCodes::GENERAL_ERROR; |
| 41 | } |
| 42 | safe_logger (spdlog::level::debug, "Library is loaded"); |
| 43 | int res = call_init (); |
| 44 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 45 | { |
| 46 | delete dll_loader; |
| 47 | dll_loader = NULL; |
| 48 | return res; |
| 49 | } |
| 50 | res = call_open (); |
| 51 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 52 | { |
| 53 | delete dll_loader; |
| 54 | dll_loader = NULL; |
| 55 | return res; |
| 56 | } |
| 57 | initialized = true; |
| 58 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 59 | } |
| 60 | |
| 61 | int DynLibBoard::start_stream (int buffer_size, const char *streamer_params) |
| 62 | { |
nothing calls this directly
no test coverage detected