| 59 | } |
| 60 | |
| 61 | int 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 | |
| 94 | int UnicornBoard::start_stream (int buffer_size, const char *streamer_params) |
| 95 | { |
nothing calls this directly
no test coverage detected